!function(){"use strict";const e={RECEIVED_ANALYTICS:"HS_CTA_PARENT_RECEIVED_ANALYTICS",DEVICE_TYPE:"HS_CTA_PARENT_DEVICE_TYPE",PROXY_ANALYTICS_FN_CALLBACK:"HS_CTA_PARENT_PROXY_ANALYTICS_FN",INIT:"HS_CTA_PARENT_INIT",SHOWING_CTA:"HS_CTA_SHOWING_CTA",SEND_EXTRACTED_STYLES:"HS_SEND_EXTRACTED_STYLES",STARTED:"HS_CTA_STARTED",NAVIGATE_PAGE:"HS_CTA_NAVIGATE_PAGE",CLICK_EVENT:"HS_CTA_CLICK_EVENT",CLOSE_INTERACTIVE:"HS_CTA_CLOSE_INTERACTIVE",HAS_CLOSED:"HS_CTA_HAS_CLOSED",NEW_HEIGHT:"HS_CTA_NEW_HEIGHT",DISPLAY_CALL_TO_ACTION:"HS_DISPLAY_CALL_TO_ACTION",PROXY_ANALYTICS:"HS_CTA_PROXY_ANALYTICS",PROXY_ANALYTICS_FN:"HS_CTA_PROXY_ANALYTICS_FN",SEND_FORM_DEFINITION:"HS_SEND_FORM_DEFINITION",SEND_CTA_CONFIG:"HS_SEND_CTA_CONFIG",SEND_EMBED_CONTEXT:"HS_SEND_EMBED_CONTEXT",RECEIVE_FILTERED_STYLESHEETS:"RECEIVE_FILTERED_STYLESHEETS",SEND_STYLESHEETS:"SEND_STYLESHEETS",RENDER_RECAPTCHA:"RENDER_RECAPTCHA",EXECUTE_RECAPTCHA:"EXECUTE_RECAPTCHA",RESET_RECAPTCHA:"RESET_RECAPTCHA",RECAPTCHA_SUCCESS:"RECAPTCHA_SUCCESS",RECAPTCHA_EXPIRED:"RECAPTCHA_EXPIRED",TRIGGER_CTA:"HS_CTA_TRIGGER_CTA",CTA_FORM_SUBMITTED:"HS_CTA_FORM_SUBMITTED",V4_FORM_READY:"HS_V4_FORM_READY",SEND_FORM_EXTRA_SUBMISSION_METADATA:"HS_SEND_FORM_EXTRA_SUBMISSION_METADATA",SEND_FORM_SUBMISSION_SUCCESS_INFO:"HS_SEND_FORM_SUBMISSION_SUCCESS_INFO",SEND_FORM_SUBMISSION_SUCCESS:"HS_SEND_FORM_SUBMISSION_SUCCESS",SEND_FORM_SUBMISSION_FAILED:"HS_SEND_FORM_SUBMISSION_FAILED",SEND_FORM_INTERACTION_NAVIGATE:"HS_SEND_FORM_INTERACTION_NAVIGATE",GET_FORM_FIELD_VALUES:"HS_GET_FORM_FIELD_VALUES",SEND_FORM_FIELD_VALUES:"HS_SEND_FORM_FIELD_VALUES",GET_FIELD_VALUE:"HS_GET_FIELD_VALUE",SET_FIELD_VALUE:"HS_SET_FIELD_VALUE",SEND_FIELD_VALUE:"HS_SEND_FIELD_VALUE"};function t(e,t={}){for(const i in t)Object.hasOwnProperty.call(t,i)&&(e.style[i]=t[i])}function i(...e){if(window.location.search.indexOf("hs_debug_interactive")>-1||window.location.host.includes("local.hsappstatic")){console.log("[web-interactives-embed]",...e);window.location.search.indexOf("hs_is_selenium")>-1&&console.log(...[...e].map((e=>JSON.stringify(e))))}}class s{constructor(){this.listeners=new Map}on(e,t){if(!this.listeners.has(e)){this.listeners.set(e,[t]);return}const i=this.listeners.get(e);this.listeners.set(e,[...i,t])}off(e){this.listeners.delete(e)}emit(e,t){const i=this.listeners.get(e);i&&i.length&&i.forEach((e=>e(t)))}reset(){this.listeners=new Map}}function n(){return new s}const o=(...e)=>{i("[GlobalIframeCommunication]",...e)};class r{constructor(){this.iframeCommunicators=new Map;this.eventEmitter=n();this.reset=()=>{this.eventEmitter.reset();this.iframeCommunicators=new Map}}registerHandler(e,t){this.eventEmitter.on(e,t)}registerHandlers(e){o("Registering handlers",e);Object.keys(e).forEach((t=>{const i=t,s=e[i];s&&this.registerHandler(i,s)}))}registerCommunicator(e,t){o("Registering communicator",t);const i=this.iframeCommunicators.get(t)||[];this.iframeCommunicators.set(t,[...i,e])}removeCommunicator(e){o("Removing Iframe Communicator from GlobalCommunication: ",e);this.iframeCommunicators.delete(e)}emit(e,t){o("Emitting event",{event:e,messagePayload:t});this.eventEmitter.emit(e,t)}broadcast(e,t){const i=this.iframeCommunicators.get(e);if(i){o("Broadcasting",i);i.forEach((e=>{e.sendMessage(t)}))}else o("Cannot find communcators array, not broadcasting",e,t)}broadcastAll(e){o("Broadcasting",e,"to all",this.iframeCommunicators);for(const[t,i]of this.iframeCommunicators)this.broadcast(t,e)}}var a=new r;function c(){return new MessageChannel}const l=(...e)=>{i("[iframeCommunication]",...e)};class h{constructor(t,i){this.queue=[];this.initialised=!1;this.events=new Map;this.eventEmitter=n();this.handleMessage=e=>{if(!e.data||!e.data.type)return;const{type:t,payload:i}=e.data;l("Handling message",{type:t,payload:i});this.eventEmitter.emit(t,i);a.emit(t,Object.assign({},i,{id:this.id}))};this.handleFrameLoaded=()=>{if(this.iframe.contentWindow){l("Iframe loaded",this.iframe);this.iframe.contentWindow.postMessage({type:e.INIT},"*",[this.channel.port2]);this.initialised=!0;this.flushQueue()}else l("Content window not there, not loading")};this.iframe=t;this.id=i;this.channel=c();this.channel.port1.onmessage=this.handleMessage;this.iframe.addEventListener("load",this.handleFrameLoaded);l("Iframe communication set up",i,t)}sendMessage({type:e,payload:t}){if(this.initialised){l("Posting message",{type:e,payload:t});this.channel.port1.postMessage({type:e,payload:t})}else{l("Queueing message",{type:e,payload:t});this.queue.push({type:e,payload:t})}}registerHandler(e,t){this.eventEmitter.on(e,t)}registerHandlers(e){l("Registering handlers in IframeCommunication",e);Object.keys(e).forEach((t=>{const i=t,s=e[i];s&&this.registerHandler(i,s)}))}removeHandler(e){l("Removing handler",e);this.eventEmitter.off(e)}remove(){l("Removing frame communicator:",this.id);this.channel.port1.close();a.removeCommunicator(this.id)}flushQueue(){if(this.initialised){l("Flushing queue",this.queue);this.queue.forEach((e=>{this.sendMessage(e)}))}else l("Not flushing queue, not initialised")}}function d(e,t){l("Creating iframe communication");const i=new h(e,t);a.registerCommunicator(i,t);return i}function u(e){const t=window.location.origin.startsWith("http:")?"http://":"https://";return e.startsWith(t)?e:`${t}${e.replace(/http(s)?:\/\//,"")}`}function m(e){e.style.border="none";e.style.height="100%";e.style.width="100%";e.style.visibility="hidden"}function g(e,t){const i=document.createElement("iframe");i.src=u(e);Object.keys(t).forEach((e=>{i.setAttribute(e,t[e])}));m(i);return i}function p(e,t,i){e.startsWith("http")||(e=`https://${e}`);const s=new URL(e);s.searchParams.set(t,i);return s.href}function f(e,t){e.startsWith("http")||(e=`https://${e}`);if(0===Object.keys(t).length)return e;const i=new URL(e);Object.keys(t).forEach((e=>i.searchParams.set(e,t[e])));return i.href}function v(e,t){return e.replace(/#.*$/,"")===t.replace(/#.*$/,"")}const C=(...e)=>{i("[FrameComponent]",...e)},T=()=>{};class E{constructor({id:e,container:t,iframeSrc:i,resizeHeight:s,onFrameReady:n,useResponsiveStyling:o,extraAttributes:r={}}){this.onFrameReady=T;this.resizeHeight=!0;this.handleHeightChange=({height:e})=>{if(!this.resizeHeight)return;const t=e+2*parseInt(getComputedStyle(this.iframe).borderTopWidth,10);C("Handle height change",this.id,{adjustedHeight:t,height:e});this.setContainerStyle({height:`${t}px`})};this.id=e;this.resizeHeight=s;if(o){C("Responsive styling is enabled",e);i=p(i,"enableResponsiveStyles","true")}this.iframe=g(i,r);this.container=t;this.iframeCommunicator=d(this.iframe,e);n&&(this.onFrameReady=n);t.appendChild(this.iframe);this.registerHandlers()}registerHandlers(){this.iframeCommunicator.registerHandlers({[e.STARTED]:this.onFrameReady,[e.NEW_HEIGHT]:this.handleHeightChange})}setStyle(e){C("Set style",this.id,e);t(this.iframe,e)}setShouldResize(e){this.resizeHeight=e}setContainerStyle(e){t(this.container,e)}}function S(e){return new E(e)}class b{constructor(e,t){this.listeners=new Set;this.batching=!1;this.queue=[];this.subscribe=e=>{this.listeners.add(e);let t=()=>{};this.options&&this.options.onSubscribe&&(t=this.options.onSubscribe(e,this));return()=>{this.listeners.delete(e);t()}};this.setState=e=>{const t=this.state;this.options&&this.options.updateFn?this.state=this.options.updateFn(t)(e):this.state=e(t);if(this.state!==t){this.queue.push((()=>{this.listeners.forEach((e=>e(this.state,t)));this.options&&this.options.onUpdate&&this.options.onUpdate(this.state,t)}));this._flush()}};this._flush=()=>{if(!this.batching){this.queue.forEach((e=>e()));this.queue=[]}};this.batch=e=>{this.batching=!0;e();this.batching=!1;this._flush()};this.state=e;this.options=t}}class y{constructor(){this.storage=[]}enqueue(e){this.storage.push(e)}dequeue(){return this.storage.shift()}peek(){return this.storage[0]}size(){return this.storage.length}}function w(){return new y}function A(e,t=!1){!window.navigator.userAgent.includes("Firefox")&&t?window.open(e,"_blank","noopener"):window.location.assign(e)}const I="hubspotutk",O="__hstc",M="__hssc",_=e=>{const t=document.cookie.match(`(^|[^;]+)\\s*${e}\\s*=\\s*([^;]+)`);return t?t.pop():""},P=()=>_(I),L=()=>_(O),F=()=>_(M),R=(...e)=>{i("[models/Analytics]",...e)};class N{constructor(){this._handleFetchSucceded=e=>{this.store.setState((t=>{const i={};i.path=e.path;i.referrerPath=e.referrerPath;i.referrer="";i.analyticsPageId=e.pageId;i.hsfp=e._getFingerprint();i.canonicalUrl=e.canonicalUrl;i.contentType=e.contentType;i.pageId=N.getPageId()||e.pageId;e.session&&(i.hssc=e.session.get());if(e.utk){i.hstc=e.utk.get();i.hutk=e.utk.visitor}return Object.assign({},t,i,{isLoaded:!0})}))};window._hsq=window._hsq||[];const e={isLoaded:!1,pageUrl:window.location.href,pageTitle:window.document.title,referrer:window.document.referrer,userAgent:window.navigator.userAgent,hutk:P(),hssc:F(),hstc:L(),pageId:N.getPageId()};this.store=new b(e);this.fetchAnalytics()}fetchAnalytics(){this._analyticsQueue.push(this._handleFetchSucceded)}subscribe(e){return this.store.subscribe(e)}get analytics(){return this.store.state}track(e){R("Tracking analytics",e);this._analyticsQueue.push(e)}get _analyticsQueue(){return window._hsq}static getPageId(){const e=window.hsVars;return e&&e.analytics_page_id?e.analytics_page_id:e&&e.page_id?e.page_id:null}static getLanguage(){const e=window.hsVars;return e&&e.language?e.language:null}}var H=new N;const k=(...e)=>{i("[AnalyticsProxyController]",...e)},D=["trackFormView","trackFormVisible","trackFormInteraction"];class V{constructor({applicationController:e,analyticsStore:t}){this.viewQueue=new Map;this.applicationController=e;this.analyticsStore=t;this.listenForAnalyticsUpdate();this.listenForProxyMessage()}listenForAnalyticsUpdate(){this.analyticsStore.subscribe(((t,i)=>{!i.isLoaded&&t.isLoaded&&a.broadcastAll({type:e.RECEIVED_ANALYTICS,payload:t})}))}flushViewQueue(e){const t=this.viewQueue.get(e)||[];for(const e of t)this.analyticsStore.track(e);this.viewQueue.delete(e)}handleFormView(e,t){const i=this.applicationController.viewedStore;if(i&&i.hasBeenViewed(e)){this.analyticsStore.track(t);return}const s=this.viewQueue.get(e)||[];k("Adding form view to analytics queue",{id:e,analytics:t});this.viewQueue.set(e,[...s,t])}listenForProxyMessage(){a.registerHandlers({[e.PROXY_ANALYTICS]:({analytics:e,id:t})=>{V.isFormView(e)?this.handleFormView(t,e):this.analyticsStore.track(e)}})}static isFormView(e){const[t]=e;return D.includes(t)}}class B{constructor({applicationController:e}){this.applicationController=e;this.listenForNavigation()}listenForNavigation(){a.registerHandlers({[e.NAVIGATE_PAGE]:({url:e,openNewTab:t,id:i})=>{const s=this.applicationController.getNavigationUrl({url:e,openNewTab:t},i);if(t)return;A(s,this.applicationController.getShouldOpenNewTab({url:e,openNewTab:t},i))}})}}class x{constructor(){this.extractedStyles={rules:{},keyframes:{}};this.crossOriginStyleSheets=new Set}extractStyles(){const e={rules:{},keyframes:{}};for(const t of document.styleSheets)if(!this.crossOriginStyleSheets.has(t))try{const i=t.cssRules||t.rules;for(const t of i)t instanceof CSSStyleRule?e.rules[t.selectorText]=this.extractProperties(t.style):t instanceof CSSKeyframesRule&&(e.keyframes[t.name]=this.extractKeyframes(t))}catch(e){this.crossOriginStyleSheets.add(t)}this.extractedStyles=e}extractProperties(e){const t={};for(const i of Array.from(e))t[i]=e.getPropertyValue(i);return t}extractKeyframes(e){const t=[];for(const i of e.cssRules){if(!(i instanceof CSSKeyframeRule))continue;const e=this.extractProperties(i.style);t.push({keyText:i.keyText,style:e})}return t}}class ${constructor(){this.analyticsStore=H;this.analyticsProxyController=new V({analyticsStore:this.analyticsStore,applicationController:this});this.navigationProxyController=new B({applicationController:this});this.styleExtractorController=new x}getNavigationUrl(e,t){return e.url}getShouldOpenNewTab(e,t){return e.openNewTab}}class U{constructor(){this.handleIntersection=e=>{e.forEach((e=>{if(e.isIntersecting){const t=e.target;this.onElementAppear(t);this.observedElements.delete(t);this.observer.unobserve(t)}}))};this.observer=new IntersectionObserver(this.handleIntersection,{threshold:.5});this.observedElements=new Map}onElementAppear(e){const t=this.observedElements.get(e);t&&t(e)}observe(e,t){if((()=>{const t=e.getBoundingClientRect(),i=window.innerHeight;return t.bottom>=0&&t.topt(i,e)));return new Map(i)}function q(e,t){const i=[...e].sort((([e,i],[s,n])=>t(i,n)));return new Map(i)}function W(e,t){const i=new Map(e);for(const[e,s]of t)i.set(e,s);return i}function z(e){const t=t=>{"Escape"===t.key&&e()};document.addEventListener("keydown",t);return()=>{document.removeEventListener("keydown",t)}}function Y(e,t){let i,s=0;return function(){const n=this,o=arguments,r=Date.now();if(r-s>=t){i&&window.clearTimeout(i);e.apply(n,o);s=r}else i||(i=window.setTimeout((()=>{e.apply(n,o);s=Date.now();i=void 0}),t))}}const Q={BANNER:"BANNER",MODAL:"MODAL",SLIDE_IN:"SLIDE_IN",EMBEDDED:"EMBEDDED"},X="na1",K=()=>document.getElementById("hubspot-web-interactives-loader"),J=(e,t)=>{if(!t)return null;const i=t.getAttribute(e);return i||null},Z=e=>{const t=J("data-hsjs-portal",e);return t?parseInt(t,10):null},ee=e=>{const t=J("data-hsjs-env",e);return t||"prod"},te=e=>{const t=J("data-hsjs-hublet",e);return t||X},ie=e=>{const t=J("data-hsjs-local",e);return!!t&&"true"===t},se=e=>J("src",e),ne=()=>{const e=K();return e?{portalId:Z(e),env:ee(e),hublet:te(e),isLocal:ie(e),src:se(e)}:null},oe=()=>window,re=["previewInteractiveId","preview_web_interactive","preview_key","_preview","portalId","hs_preview"];function ae(){const e=new URLSearchParams(oe().location.search),t={};e.forEach(((e,i)=>{re.includes(i)||(t[i]=e)}));return t}function ce({contentId:e,portalId:t,env:i,hublet:s,useSameOrigin:n=!1}){const o="qa"===i?"qa":"",r=s===X?"":`-${s}`,a=document.location.protocol;return n?`${window.location.origin}/hs-web-interactive-${t}-${e}`:`${a}//${t}.hs-sites${o}${r}.com/hs-web-interactive-${t}-${e}`}function le(e,t,i){const s=oe();let n={};t.contactPreviewEmail&&(n.email=t.contactPreviewEmail);const o=i.analytics&&i.analytics.hutk;o&&(n.utk=o);s.location.search.includes("hs_debug_interactive")&&(n.hs_debug_interactive="true");const r=ae();n=Object.assign({},r,n);return f(e,n)}function he(e,t){if(null==e)return{};var i,s,n={},o=Object.keys(e);for(s=0;s=0||(n[i]=e[i])}return n}const de={APP:"app",APP_API:"app-api"};function ue(e,t){const i=t&&t.hubletOverride?t.hubletOverride:e;return i===X?"":`-${i}`}function me(e,t,i){if(i&&i.hubletPostfixLocation&&"domain"===i.hubletPostfixLocation)return t;t===de.APP_API&&(t=de.APP);return`${t}${ue(e,i)}`}function ge(e,t,i){return`${fe(i)}${pe(t,i)}${ve(e,i)}`}function pe(e,t){return"qa"===(t&&t.envOverride?t.envOverride:e)?"qa":""}function fe(e){return e&&e.domainOverride?e.domainOverride:"hubspot"}function ve(e,t){return t&&t.hubletPostfixLocation&&"domain"===t.hubletPostfixLocation?ue(e,t):""}function Ce(e){return e&&e.tldOverride?e.tldOverride:"com"}function Te(e){return e===de.APP_API?"/api":""}function Ee(e,t,i,s){return`https://${me(t,e,s)}.${ge(t,i,s)}.${Ce(s)}${Te(e)}`}function Se(e,t){t.hutk&&e.searchParams.set("utk",`${t.hutk}`);t.hstc&&e.searchParams.set("__hstc",`${t.hstc}`);t.hssc&&e.searchParams.set("__hssc",`${t.hssc}`);t.referrer&&e.searchParams.set("referrer",`${t.referrer}`);t.pageId&&e.searchParams.set("contentId",t.pageId)}function be({contentIds:e,currentUrl:t,isPreview:i,portalId:s,env:n,hublet:o=X,versionId:r,analytics:a,extraParams:c,path:l}){let h="";if(window.location.search.includes("useLocalPublicService"))h=`https://local.hubspotqa.com/web-interactives/public/v1/${l}`;else{h=Ee(o===X?"cta-service-cms2":"cta",o,n,{tldOverride:"com",domainOverride:"hubspot"});h=`${h}/web-interactives/public/v1/${l}`}const d=new URL(h);i&&d.searchParams.set("isPreview","true");e&&e.length&&e.forEach((e=>d.searchParams.append("contentIds",`${e}`)));s&&d.searchParams.set("portalId",`${s}`);t&&!i&&d.searchParams.set("currentUrl",t);r&&d.searchParams.set("versionId",`${r}`);a&&!i&&Se(d,a);c&&Object.keys(c).forEach((e=>d.searchParams.set(e,`${c[e]}`)));return d.href}const ye=["previewScheduled","templatePath","isMobile"],we="embed/combinedConfigs",Ae="embed/templateConfig";function Ie(e){let{previewScheduled:t,templatePath:i,isMobile:s}=e,n=he(e,ye),o="";o=i?Ae:we;const r={};t&&(r.previewScheduled="true");i&&(r.templatePath=i);s&&(r.isMobile="true");return be(Object.assign({},n,{extraParams:r,path:o}))}const Oe={TOP:"TOP",BOTTOM:"BOTTOM",TOP_LEFT:"TOP_LEFT",TOP_RIGHT:"TOP_RIGHT",BOTTOM_LEFT:"BOTTOM_LEFT",BOTTOM_RIGHT:"BOTTOM_RIGHT"},Me=-1,_e=(e,t=1)=>{if(!e)return{r:null,g:null,b:null,a:t};if(3===(e=e.replace("#","")).length){const t=e.split("").reduce(((e,t)=>e+t+t),"");e=t}return{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:t}},Pe=(e,t=1)=>{const i=_e(e,t);return`rgba(${i.r}, ${i.g}, ${i.b}, ${i.a})`};class Le{constructor(){this.fetchConfigs=()=>{const e=this.store.state.configRequest;if(!e)return Promise.resolve(null);const t=Ie(e);return this.fetch(t)};this.handleFetchFailed=()=>{this.store.setState((e=>Object.assign({},e,{requestError:!0})))};this.handleFetchSucceded=({sortedAudienceConfigs:e,requestedConfigs:t})=>{const i=structuredClone(this.configs);e&&e.length&&e.forEach((e=>i.set(e.contentModelId,e)));t&&t.length&&t.forEach((e=>{i.has(e.contentModelId)||i.set(e.contentModelId,e)}));this.store.setState((e=>Object.assign({},e,{configs:i,isLoaded:!0})))};this.handleTemplateSucceded=e=>{const t=Object.assign({},e,{contentModelId:Me});this.store.setState((e=>Object.assign({},e,{templateConfig:t,isLoaded:!0})))};const e={configs:new Map,configRequest:null,requestError:!1,isLoaded:!1};this.store=new b(e)}init(e){this.store.setState((t=>Object.assign({},t,{configRequest:e})));return this.fetchConfigs()}subscribe(e){return this.store.subscribe(e)}get configs(){return this.store.state.configs}get isLoaded(){return this.store.state.isLoaded}get sortedConfigsWithSpecificty(){return q(this.configsWithAudience,((e,t)=>t.specificity-e.specificity))}get configsWithAudience(){return j(this.configs,(e=>e.specificity>0))}get overlayedConfigsWithNoAudience(){return j(this.overlayedConfigs,(e=>!e.specificity))}get overlayedConfigs(){return j(this.configs,(e=>e.containerType!==Q.EMBEDDED))}get embeddedConfigs(){const e=j(this.configs,(e=>e.containerType===Q.EMBEDDED));this.templateConfig&&this.templateConfig.containerType===Q.EMBEDDED&&e.set(Me,this.templateConfig);return e}get templateConfig(){return this.store.state.templateConfig}get previewConfig(){const[e]=this.store.state.configs.values();return e}fetch(e){return fetch(e).then((e=>{if(!e.ok){this.handleFetchFailed();return Promise.resolve(null)}return e.json().then((e=>{e.templatePath?this.handleTemplateSucceded(e):this.handleFetchSucceded(e);return e})).catch(this.handleFetchFailed)})).catch(this.handleFetchFailed)}fetchConfigsWithIds(e){const t=this.store.state.configRequest;if(!t)return;const i=Ie(Object.assign({},t,{contentIds:e}));this.fetch(i)}static getStylesFromContainerStyles(e){let t=e.width.value||5,i=e.height.value||5;"px"===e.width.units&&(t=Math.max(t,5));"px"===e.height.units&&(i=Math.max(i,5));return{width:`${t}${e.width.units}`,height:`${i}${e.height.units}`}}static getStylesForIframe(e){const t={},{border:i,borderRadius:s,boxShadow:n}=e;i&&(t.border=`${i.width.value}${i.width.units} ${i.style} ${Pe(i.color,i.opacity/100)}`);n&&n.css&&(t.boxShadow=n.css.split(":")[1]);s&&(t.borderRadius=`${s.value}${s.units}`);return t}static isFloatingButtonLike(e){return"isDismissable"in e&&(e.containerType===Q.SLIDE_IN&&!e.isDismissable)}static isTopBannerLike(e){return e.containerType===Q.BANNER&&e.containerStyles.position===Oe.TOP}static buildConfigRequest(e,t=[],i){const{isPreview:s,currentUrl:n,portalId:o,env:r,hublet:a,isMobile:c,templatePath:l,versionId:h}=e;return{contentIds:t,currentUrl:n,portalId:o,env:r,hublet:a,analytics:Object.assign({},i),isMobile:c,isPreview:s,templatePath:l,versionId:h}}}var Fe=new Le;const Re=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),Ne=["hs_preview","preview_key"],He=e=>({bfCacheReload:[23273748,19651225].includes(e),closeCTAOnNavigation:[23273748,1854059].includes(e)});class ke{constructor(){this.portalId=0;this.env="";this.hublet=X;this.isLocal=!1;this.isMobile=!1;this.isLiveHSPage=!1;this.isPreview=!1;this.isScreenshot=!1;this.isTemplate=!1;this.previewScheduled=!1;this.enableResponsiveStyles=!1;this.isPreviewPage=!1;this.gates=[];this.patches={bfCacheReload:!1,closeCTAOnNavigation:!1};this.win=oe();this.currentUrl=this.win.location.href}init(){this._setEnvProps();this._setUrlProps()}_setEnvProps(){var e,t,i;const s=ne();this.portalId=s.portalId;this.hublet=s.hublet;this.env=s.env;this.isLocal=s.isLocal;this.isMobile=Re();this.isPreviewPage=Ne.some((e=>this.win.location.search.includes(e)));this.pageId=(null===(e=this.win.hsVars)||void 0===e?void 0:e.analytics_page_id)||(null===(t=this.win.hsVars)||void 0===t?void 0:t.page_id);this.isLiveHSPage=Boolean(this.pageId);this.language=null===(i=this.win.hsVars)||void 0===i?void 0:i.language;this.patches=He(this.portalId)}isCosPreviewPage(){const e=this.win.location.toString();return/preview(-[^.]+)?\.hs-sites(qa)?(-[^.]+)?\.com/g.test(e)||/hubspotpreview(qa)?(-[^.]+)?/.test(e)||this.win.location.search.includes("hs_preview")||this.win.location.search.includes("preview_key")}isCos(){if(this.win.hsVars&&this.win.hsVars.portal_id)return!0;return[...document.getElementsByTagName("meta")].some((e=>"generator"===e.getAttribute("name")&&"HubSpot"===e.getAttribute("content")))}_setUrlProps(){const e=new URLSearchParams(this.win.location.search);if(e.has("templatePath")){this.templatePath=e.get("templatePath");this.isTemplate=!0}e.has("previewScheduled")&&(this.previewScheduled="true"===e.get("previewScheduled"));e.has("enableResponsiveStyles")&&(this.enableResponsiveStyles="true"===e.get("enableResponsiveStyles"));e.has("versionId")&&(this.versionId=parseInt(e.get("versionId"),10));if(e.has("screenshotBodyHeight")){this.screenshotBodyHeight=parseInt(e.get("screenshotBodyHeight"),10);this.isScreenshot=!0}if(e.has("publishedPreview")){this.isPreview=!0;this.previewScheduled=!0;this.versionId=-1}if(e.has("previewInteractiveId")){this.previewId=parseInt(e.get("previewInteractiveId"),10);this.isPreview=!0}this.isPreview&&e.has("email")&&(this.contactPreviewEmail=e.get("email"));this.currentUrl=this.win.location.href}setGates(e){this.gates=e}isUngatedFor(e){return this.gates.includes(e)}refresh(){this._setUrlProps()}}var De=new ke;class Ve{constructor(){this.markAsViewed=e=>{this.store.setState((t=>Object.assign({},t,{viewed:new Set([...t.viewed,e])})))};const e={viewed:new Set};this.store=new b(e)}subscribe(e){this.store.subscribe(e)}hasBeenViewed(e){return this.store.state.viewed.has(e)}get viewed(){return this.store.state.viewed}}function Be(){return new Ve}const xe="hs-cta-trigger-button",$e="hs-cta-embed",Ue="web-interactives-preview-wrapper";var Ge=()=>Array.from(document.getElementsByClassName(xe));var je=()=>Array.from(document.getElementsByClassName($e));const qe=()=>{try{return Array.from(document.querySelectorAll("a[href*='HS_DISPLAY_CALL_TO_ACTION'"))}catch(e){return[]}},We=e=>{const t=e.getAttribute("href");if(!t)return null;const i=/\(([^)]+)\)/.exec(t);if(!i)return null;const s=i[1];return s?JSON.parse(s.replace(/(['"])?([a-z0-9A-Z_]+)(['"])?:/g,'"$2": ').replaceAll("'",'"')).id:null};var ze=e=>{const t=Array.from(e.classList).filter((e=>e.startsWith(xe)&&e!==xe||e.startsWith($e)&&e!==$e)).map((e=>e.split("-").pop()));let i=Number(t);if(Number.isNaN(i)){const t=e.dataset.hubspotWrapperCtaId;i=Number(t)}return i};function Ye(e){return Number(e.dataset.hubspotWrapperCtaId)}function Qe(){return Array.from(document.querySelectorAll(".hs-web-interactive-inline[data-hubspot-wrapper-cta-id]"))}const Xe=()=>{const e=new Map,t=new Map,i=new Map,s=new Set,n=new Set,o=new Set;Ge().forEach((t=>{const i=ze(t);s.add(i);const n=e.get(i);n?e.set(i,[...n,t]):e.set(i,[t])}));je().forEach((e=>{const i=ze(e);n.add(i);const s=t.get(i);s?t.set(i,[...s,e]):t.set(i,[e])}));qe().forEach((t=>{const i=We(t);if(!i)return;s.add(i);const n=e.get(i);n?e.set(i,[...n,t]):e.set(i,[t])}));Qe().forEach(((e,t)=>{const s=Ye(e);if(!s)return;e.id=`hs-interactive-container-${s}-${t}`;o.add(s);const n=i.get(s);n?i.set(s,[...n,e]):i.set(s,[e])}));const r=[...new Set([...s,...n,...o])];return{clickTriggerButtons:e,embedContainers:t,nonFramedCTAContainers:i,clickTriggerIds:s,embedIds:n,nonFramedIds:o,uniqueIds:r}},Ke=(e,t)=>{const i=document.createElement("div");i.innerHTML=t;return i.firstElementChild};let Je={data:""},Ze=e=>{try{let t=e?e.querySelector("#_goober"):self._goober;return t||(t=(e||document.head).appendChild(document.createElement("style")),t.innerHTML=" ",t.id="_goober"),t.firstChild}catch(e){}return Je},et=/(?:([a-z0-9-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(})/gi,tt=/\/\*.*?\*\/|\s{2,}|\n/gm,it=(e,t,i)=>{let s="",n="",o="";for(let r in e){let a=e[r];if("object"==typeof a){let e=t+" "+r;/&/g.test(r)&&(e=r.replace(/&/g,t)),"@"==r[0]&&(e=t,"f"==r[1]&&(e=r)),/@k/.test(r)?n+=r+"{"+it(a,"","")+"}":n+=it(a,e,e==t?r:i||"")}else/^@i/.test(r)?s=r+" "+a+";":o+=it.p?it.p(r.replace(/[A-Z]/g,"-$&").toLowerCase(),a):r.replace(/[A-Z]/g,"-$&").toLowerCase()+":"+a+";"}if(o[0]){let e=t+"{"+o+"}";return i?n+i+"{"+e+"}":s+e+n}return s+n},st={},nt=(e,t,i,s)=>{let n=e.toLowerCase?e:function e(t){let i="";for(let s in t)"object"==typeof val?i+=s+e(t[s]):i+=s+t[s];return i}(e),o=st[n]||(st[n]=".go"+n.split("").reduce(((e,t)=>101*e+t.charCodeAt(0)>>>0),11));return((e,t,i)=>{t.data.indexOf(e)<0&&(t.data=i?e+t.data:t.data+e)})(st[o]||(st[o]=it(e[0]?(e=>{let t,i=[{}];for(;t=et.exec(e.replace(tt,""));)t[4]&&i.shift(),t[3]?i.unshift(i[0][t[3]]=i[0][t[3]]||{}):t[4]||(i[0][t[1]]=t[2]);return i[0]})(e):e,i?"":o)),t,s),o.slice(1)},ot=(e,t,i)=>e.reduce(((e,s,n)=>{let o=t[n];if(o&&o.call){let e=o(i),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;o=t?"."+t:e&&e.props?"":e}return e+s+(null==o?"":o)}),"");function rt(e){let t=this||{},i=e.call?e(t.p):e;return nt(i.map?ot(i,[].slice.call(arguments,1),t.p):i,Ze(t.target),t.g,t.o)}rt.bind({g:1});const at=rt(["position:fixed;display:block;width:100%;height:0px;margin:0px;padding:0px;overflow:visible;transform-style:preserve-3d;background:transparent;backface-visibility:hidden;pointer-events:none;left:0px;z-index:9998;"]),ct=rt(["top:0px;z-index:9999;height:100%;width:100%;"]),lt=rt(["bottom:0px;"]),ht=rt(["position:fixed;z-index:9989;"]),dt=rt(["left:0;bottom:0;"]),ut=rt(["right:0;bottom:0;"]),mt=rt(["left:0;top:0;"]),gt=rt(["right:0;top:0;"]),pt=rt(["position:relative;overflow:hidden;display:none;"]),ft=rt(["display:block;"]),vt="hs-web-interactives-banner-style-element",Ct="hs-web-interactives-top-banner-open",Tt="hs-web-interactives-top-anchor",Et="hs-web-interactives-top-push-anchor",St="hs-web-interactives-bottom-anchor",bt="hs-web-interactives-floating-container",yt="hs-web-interactives-floating-top-left-anchor",wt="hs-web-interactives-floating-top-right-anchor",At="hs-web-interactives-floating-bottom-left-anchor",It="hs-web-interactives-floating-bottom-right-anchor",Ot=e=>`\n .${Ct} .hs-is-fixed-element {\n translate: 0px ${e}px!important;\n }\n`,Mt=()=>`\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n`;class _t{constructor(){this.render();this.topPushAnchor=document.getElementById(Et);this.topAnchor=document.getElementById(Tt);this.bottomAnchor=document.getElementById(St);this.floatingAnchors={[Oe.TOP_LEFT]:document.getElementById(yt),[Oe.TOP_RIGHT]:document.getElementById(wt),[Oe.BOTTOM_LEFT]:document.getElementById(At),[Oe.BOTTOM_RIGHT]:document.getElementById(It)};this.bottomRightFloatingButtonAnchor=this.floatingAnchors.BOTTOM_RIGHT}attachInteractiveOverlayToAnchor(e){e.containerType!==Q.MODAL?e.isFloatingButtonLike?this.attachFloatingButton(e):e.containerType!==Q.BANNER&&e.containerType!==Q.SLIDE_IN||this.attachBanner(e):this.attachModal(e)}attachModal(e){this.topAnchor.appendChild(e.container)}attachBanner(e){e.position===Oe.BOTTOM||e.position===Oe.BOTTOM_LEFT||e.position===Oe.BOTTOM_RIGHT?this.bottomAnchor.appendChild(e.container):e.position!==Oe.TOP&&e.position!==Oe.TOP_RIGHT&&e.position!==Oe.TOP_LEFT||this.topAnchor.appendChild(e.container)}attachFloatingButton(e){const t=this.floatingAnchors[e.position];t&&t.appendChild(e.container)}addMarginForConversations(e){this.bottomRightFloatingButtonAnchor.style.marginBottom=`${e}px`}removeMarginForConversations(){this.bottomRightFloatingButtonAnchor.style.marginBottom=""}insertPushBanner(){const e=document.createElement("div");e.id=Et;e.classList.add(pt);document.body.prepend(e)}setTopPushHeight(e){this.topPushAnchor.style.height=`${e}px`}showPushBanner(e){this.setTopPushHeight(e);this.topPushAnchor.classList.add(ft);document.body.classList.add(Ct);const t=document.createElement("style");t.id=vt;t.innerHTML=Ot(e);document.head.appendChild(t)}hidePushBanner(){this.topPushAnchor.classList.remove(ft);document.body.classList.remove(Ct);const e=document.getElementById(vt);e&&document.head.removeChild(e)}render(){this.insertPushBanner();document.body.insertAdjacentHTML("beforeend",Mt())}}const Pt=rt(["position:absolute;pointer-events:none;width:101vw;height:101vh;background:rgba(0,0,0,0.7);opacity:0;z-index:-1;"]),Lt=rt(["z-index:99998;opacity:0.8;visibility:visible;pointer-events:all;cursor:pointer;"]),Ft=rt(["overflow:hidden;"]);class Rt{constructor({parent:e,handleClick:t=(()=>{})}){this.disableBodyScroll=!1;this.overlay=document.createElement("div");this.overlay.id="hs-interactives-modal-overlay";this.overlay.classList.add(Pt);this.handleClick=t;this.render(e);this.listenForClick()}listenForClick(){this.overlay.addEventListener("click",this.handleClick)}enableDisableBodyScroll(){this.disableBodyScroll=!0}show(){this.overlay.classList.add(Lt);this.disableBodyScroll&&document.body.classList.add(Ft)}hide(){this.overlay.classList.remove(Lt);document.body.classList.remove(Ft)}render(e){e.appendChild(this.overlay)}}const Nt={modalPosition:null,bannerPositions:{TOP_LEFT:null,TOP_RIGHT:null,BOTTOM_LEFT:null,BOTTOM_RIGHT:null,BOTTOM:null,TOP:null},floatingPositions:{TOP_LEFT:null,TOP_RIGHT:null,BOTTOM_LEFT:null,BOTTOM_RIGHT:null}},Ht=[Oe.TOP,Oe.TOP_LEFT,Oe.TOP_RIGHT],kt=[Oe.BOTTOM,Oe.BOTTOM_LEFT,Oe.BOTTOM_RIGHT];class Dt{constructor({isMobile:e=!1}){this.isMobile=!1;this.store=new b(Nt);this.isMobile=e}setPosistionFromConfig(e){const{contentModelId:t,containerType:i,containerStyles:{position:s}}=e,n=Le.isFloatingButtonLike(e);i===Q.MODAL?this.setModalPosition(t):i!==Q.BANNER&&!Q.SLIDE_IN||n?n&&this.setFloatingPosition(s,t):this.setBannerPosition(s,t)}get modalPosition(){return this.store.state.modalPosition}get bannerPositions(){return this.store.state.bannerPositions}get floatingPositions(){return this.store.state.floatingPositions}canBeInsertedIntoPosition(e){return this.isMobile?this.canBeInsertedIntoPositionMobile(e):this.canBeInsertedIntoPositionDesktop(e)}canBeInsertedIntoPositionMobile(e){const t=Le.isFloatingButtonLike(e);return e.containerType===Q.MODAL?!this.modalPosition:e.containerType===Q.BANNER||e.containerType===Q.SLIDE_IN&&!t?Object.keys(this.bannerPositions).reduce(((e,t)=>e&&!this.bannerPositions[t]),!0):!!t&&Object.keys(this.floatingPositions).reduce(((e,t)=>e&&!this.floatingPositions[t]),!0)}canBeInsertedIntoPositionDesktop(e){const t=Le.isFloatingButtonLike(e);return e.containerType===Q.MODAL?!this.modalPosition:e.containerType===Q.BANNER||e.containerType===Q.SLIDE_IN&&!t?kt.includes(e.containerStyles.position)?!this.bannerPositions[Oe.BOTTOM]&&!this.bannerPositions[Oe.BOTTOM_LEFT]&&!this.bannerPositions[Oe.BOTTOM_RIGHT]:!!Ht.includes(e.containerStyles.position)&&(!this.bannerPositions[Oe.TOP]&&!this.bannerPositions[Oe.TOP_LEFT]&&!this.bannerPositions[Oe.TOP_RIGHT]):!!t&&!this.floatingPositions[e.containerStyles.position]}setModalPosition(e){this.store.setState((t=>Object.assign({},t,{modalPosition:e})))}setBannerPosition(e,t){this.store.setState((i=>{const s=i.bannerPositions;return Object.assign({},i,{bannerPositions:Object.assign({},s,{[e]:t})})}))}setFloatingPosition(e,t){this.store.setState((i=>{const s=i.floatingPositions;return Object.assign({},i,{floatingPositions:Object.assign({},s,{[e]:t})})}))}getAllIds(){const e=[];"number"==typeof this.modalPosition&&null!==this.modalPosition&&e.push(this.modalPosition);for(const[t,i]of Object.entries(this.bannerPositions))i&&Number.isInteger(i)&&e.push(i);for(const[t,i]of Object.entries(this.floatingPositions))i&&Number.isInteger(i)&&e.push(i);return e}removeCTA(e){this.modalPosition===e&&this.store.setState((e=>Object.assign({},e,{modalPosition:null})));for(const[t,i]of Object.entries(this.bannerPositions))i===e&&this.store.setState((e=>Object.assign({},e,{bannerPositions:Object.assign({},e.bannerPositions,{[t]:null})})));for(const[t,i]of Object.entries(this.floatingPositions))i===e&&this.store.setState((e=>Object.assign({},e,{floatingPositions:Object.assign({},e.floatingPositions,{[t]:null})})))}}function Vt(e){return new Dt({isMobile:e})}const Bt=6e4,xt=1440*Bt,$t=7*xt,Ut=4*$t,Gt={REPEAT_ONCE:"REPEAT_ONCE",REPEAT_FOREVER:"REPEAT_FOREVER",ONCE_OFF:"ONCE_OFF"},jt={DAYS:"DAYS",MONTHS:"MONTHS",WEEKS:"WEEKS",MINUTES:"MINUTES"},qt=Object.freeze({DAYS:xt,MONTHS:Ut,WEEKS:$t,MINUTES:Bt}),Wt="WI_IGNORED",zt="WI_FREQUENCY",Yt={frequency:Gt.REPEAT_ONCE,backoff:{backoffTimeDuration:2,backoffTimeUnit:jt.WEEKS}},Qt=e=>{try{if(!localStorage.getItem(`${zt}_${e}`)){const t=localStorage.getItem(`${Wt}_${e}`);if(!t)return!1;return parseInt(t,10)>Date.now()-2*qt.WEEKS}const t=JSON.parse(localStorage.getItem(`${zt}_${e}`));switch(t.frequency){case Gt.ONCE_OFF:return!0;case Gt.REPEAT_FOREVER:return!1;case Gt.REPEAT_ONCE:{const{timeSaved:e,backoffTimeDuration:i,backoffTimeUnit:s}=t,n=i*qt[s];return e>Date.now()-n}default:return!1}}catch(e){return!1}},Xt=(e,t)=>{let i=t;i&&i.frequency||(i=Yt);const{frequency:s,backoff:n}=i;try{let t={frequency:s};n&&(t=Object.assign({},t,n,{timeSaved:Date.now()}));localStorage.setItem(`${zt}_${e}`,JSON.stringify(t))}catch(e){return}},Kt=(e,{frequency:t,backoff:i})=>{try{if(!t)return;const s=`${zt}_${e}`,n=JSON.parse(localStorage.getItem(s));if(!n)return;if(n.frequency!==t){localStorage.removeItem(s);return}if(!i||!n.backoffTimeDuration)return;i.backoffTimeDuration===n.backoffTimeDuration&&i.backoffTimeUnit===n.backoffTimeUnit||localStorage.removeItem(s)}catch(e){return}},Jt=rt(["display:block !important;position:static !important;box-sizing:border-box !important;background:transparent !important;border:none;min-height:0px !important;max-height:none !important;margin:0px;padding:0px !important;height:100% !important;width:1px !important;max-width:100% !important;min-width:100% !important;"]);function Zt(e,t={}){i("Setting style on element",t,e);for(const i in t)Object.hasOwnProperty.call(t,i)&&(e.style[i]=t[i])}const ei="hs-cta-embed__loaded",ti=()=>{};class ii{constructor({src:e,contentId:t,containerStyle:i,configStyle:s,iframeStyle:n,containerType:o,isFloatingButtonLike:r,isTopBanner:a,isActiveAbTest:c}){this.onClose=ti;this.handleStart=e=>{if(this.isActiveAbTest&&e.containerStyles){this.iframeStyle=Le.getStylesForIframe(e.containerStyles);this.containerStyle=Le.getStylesFromContainerStyles(e.containerStyles);this.applyStyleElements()}};this.setDeferredPromise();this.container=document.createElement("div");this.contentId=t;this.container.id=`hs-overlay-cta-${t}`;this.frameComponent=S({container:this.container,id:t,iframeSrc:e,onFrameReady:this.resolveFrameload,resizeHeight:s.scaleHeightToFitContent||Boolean(s.isSingleModuleOnly),useResponsiveStyling:s.useResponsiveStyling,extraAttributes:{"aria-label":"Popup CTA",title:"Popup CTA",allow:"autoplay; fullscreen; clipboard-write"}});this.frameComponent.iframe.setAttribute("data-test-id","interactive-frame");this.frameComponent.iframe.classList.add(Jt);this.containerStyle=i;this.iframeStyle=n;this.configStyle=s;this.containerType=o;this.position=s.position||null;this.isFloatingButtonLike=r;this.isTopBanner=a;this.isActiveAbTest=c;this.applyStyleElements();this.render();this.listenForStart()}applyStyleElements(){this.frameComponent.setStyle(this.iframeStyle);Zt(this.container,this.containerStyle)}setDeferredPromise(){this.frameLoadPromise=new Promise((e=>{this.resolveFrameload=e}))}open(){return this.frameLoadPromise.then((()=>{this.frameComponent.setStyle({visibility:""});this.container.classList.add(ei);this.internalOpen()})).catch((()=>{}))}close(){}render(){}skipAnimation(){}setAnimationForClickTrigger(){}registerResizeHandler(t){this.frameComponent.iframeCommunicator.registerHandlers({[e.NEW_HEIGHT]:t})}registerCloseHandler(t){this.frameComponent.iframeCommunicator.registerHandlers({[e.CLOSE_INTERACTIVE]:t})}listenForStart(){this.frameComponent.iframeCommunicator.registerHandlers({[e.STARTED]:this.handleStart})}internalOpen(){}remove(){this.frameComponent.iframeCommunicator.remove();this.container.remove()}}const si=(...e)=>{i("[overlays/Modal]",...e)},ni=rt(["z-index:99999;visibility:hidden;position:absolute;inset:50vh auto auto 50%;transform:translate(-50%,-50%);left:50%;top:150%;pointer-events:none;max-height:95%;max-width:95%;"]),oi=rt(["pointer-events:auto !important;visibility:visible;top:50%;transition:top 0.75s linear(0,0.006,0.023 2.2%,0.096 4.8%,0.532 15.4%,0.72 21%,0.793,0.853 26.7%,0.902,0.941,0.968 36.2%,0.987 39.7%,1 43.7%,1.007 48.3%,1.009 55.3%,1.002 78.2%,1 );"]),ri=rt(["transition:opacity 0.3s ease-in;"]);class ai extends ii{internalOpen(){this.container.classList.add(oi);this.focusElement()}focusElement(){try{this.frameComponent.iframe.focus()}catch(e){si("Frame not defined",e)}}setAnimationForClickTrigger(){this.container.classList.add(ri)}close(){this.container.classList.remove(oi)}render(){this.frameComponent.iframe.setAttribute("role","dialog");this.frameComponent.iframe.setAttribute("aria-modal","true");this.container.classList.add(ni)}}const ci=rt(["pointer-events:auto !important;visibility:visible !important;max-height:95vh !important;transition:max-height 1s ease-in;"]),li=rt(["z-index:9999;width:100%;max-height:0px;position:fixed;max-height:95%;visibility:hidden;"]),hi=rt(["z-index:9999;width:100%;max-height:0px;position:fixed;max-height:95%;visibility:hidden;bottom:0px;"]),di={[Oe.TOP]:li,[Oe.BOTTOM]:hi};class ui extends ii{internalOpen(){this.container.classList.add(ci)}close(){this.container.classList.remove(ci)}addPositionClass(){const{position:e}=this.configStyle;this.container.classList.add(di[e])}render(){this.addPositionClass();this.container.classList.add(li)}}const mi=rt(["visibility:hidden;"]),gi=rt(["visibility:visible !important;"]);class pi extends ii{internalOpen(){this.container.classList.add(gi)}close(){this.container.classList.remove(gi)}render(){this.container.classList.add(mi)}}const fi=rt(["pointer-events:auto !important;visibility:visible !important;max-height:95vh !important;transform:none !important;"]),vi=rt(["z-index:9999;width:100%;max-height:0px;position:fixed;max-height:95%;visibility:hidden;transition:transform 1s linear(0,0.006,0.022 2.3%,0.091 5.1%,0.18 7.6%,0.508 16.3%,0.607,0.691,0.762,0.822 28.4%,0.872,0.912 35.1%,0.944 38.9%,0.968 43%,0.985 47.6%,0.996 53.1%,1.001 58.4%,1.003 65.1%,1 );"]),Ci=rt(["z-index:9999;position:fixed;left:10px;top:10px;max-height:95vh !important;max-width:95%;visibility:hidden;"]),Ti=rt(["z-index:9999;position:fixed;right:10px;top:10px;max-height:95vh !important;max-width:95%;visibility:hidden;"]),Ei=rt(["z-index:9999;position:fixed;left:10px;bottom:10px;max-height:95vh !important;max-width:95%;visibility:hidden;"]),Si=rt(["z-index:9999;position:fixed;right:10px;bottom:10px;max-height:95vh !important;max-width:95%;visibility:hidden;"]),bi=rt(["transition:none !important;"]),yi={[Oe.BOTTOM_RIGHT]:Si,[Oe.BOTTOM_LEFT]:Ei,[Oe.TOP_RIGHT]:Ti,[Oe.TOP_LEFT]:Ci};class wi extends ii{internalOpen(){this.container.classList.add(fi)}close(){this.container.classList.remove(fi)}skipAnimation(){this.container.classList.add(bi)}addPositionClass(){const{position:e}=this.configStyle;this.container.classList.add(yi[e])}addOffset(){const e=this.containerStyle.width;if(!e)return;switch(this.configStyle.position){case Oe.BOTTOM_LEFT:case Oe.TOP_LEFT:this.container.style.transform=`translateX(-${e})`;return;case Oe.BOTTOM_RIGHT:case Oe.TOP_RIGHT:this.container.style.transform=`translateX(calc(100% + ${e}))`;return}}render(){this.addPositionClass();this.addOffset();this.frameComponent.iframe.setAttribute("role","dialog");this.container.classList.add(vi)}}function Ai(e,t){const i=Le.isFloatingButtonLike(e),s=Le.isTopBannerLike(e),n={src:t,configStyle:e.containerStyles,contentId:e.contentModelId,containerType:e.containerType,containerStyle:Le.getStylesFromContainerStyles(e.containerStyles),iframeStyle:Le.getStylesForIframe(e.containerStyles),isFloatingButtonLike:i,isTopBanner:s,isActiveAbTest:e.isActiveAbTest};if(i)return new pi(n);switch(e.containerType){case Q.MODAL:return new ai(n);case Q.BANNER:return new ui(n);case Q.SLIDE_IN:return new wi(n);default:return null}}function Ii(e){return e.button<2}const Oi=(...e)=>{i("[ClickTrigger",...e)},Mi=rt(["cursor:pointer;"]);class _i{constructor(e,t){this.button=e;this.onClick=t;this.init();this.addA11yAttributes()}addA11yAttributes(){this.button.setAttribute("aria-haspopup","dialog");this.button.setAttribute("tabindex","0")}init(){Oi("Setting up click trigger");this.button.removeAttribute("href");this.button.removeAttribute("target");this.button.classList.add(Mi);this.button.removeAttribute("href");this.button.removeAttribute("target");this.button.addEventListener("mouseup",(e=>{Oi("Mouse up on click trigger",e);Ii(e)&&this.onClick()}));this.button.addEventListener("keypress",(e=>{if("Enter"===e.key){Oi("Enter on click trigger",e);this.onClick()}}))}}class Pi{constructor({onTrigger:e}){this.isExitIntent=e=>{if(!e)return!1;return!e.relatedTarget&&e.clientY<100};this.handleMouseOut=e=>{this.isExitIntent(e)&&this.onTrigger(this)};this.onTrigger=e;this.setup()}setup(){document.addEventListener("mouseout",this.handleMouseOut)}remove(){document.removeEventListener("mouseout",this.handleMouseOut)}}const Li=1e3,Fi=["mousedown","mousemove","keypress","scroll","touchstart"];class Ri{constructor({onTrigger:e,value:t}){this.resetTimer=()=>{this.timeout&&clearTimeout(this.timeout);this.timeout=setTimeout((()=>this.onTrigger(this)),this.seconds)};this.onTrigger=e;this.seconds=t*Li;this.timeout=null;this.setup()}setup(){this.timeout=setTimeout((()=>this.onTrigger(this)),this.seconds);Fi.forEach((e=>{document.addEventListener(e,this.resetTimer)}))}remove(){Fi.forEach((e=>{document.removeEventListener(e,this.resetTimer)}));this.timeout&&clearTimeout(this.timeout)}}function Ni(){let e=!1;try{const t={get passive(){e=!0}};window.addEventListener("test",t,t);window.removeEventListener("test",t,t)}catch(t){e=!1}return e}function Hi(){return Math.max(document.body.offsetHeight,document.body.scrollHeight)}function ki(){return Math.max(window.innerHeight||0,document.documentElement.clientHeight)}function Di(){return document.body.scrollTop||document.documentElement.scrollTop}class Vi{constructor({onTrigger:e,value:t}){this.handleScroll=()=>{const e=Hi()-ki();100*Di()/e>=this.scrollPercent&&this.onTrigger(this)};this.onTrigger=e;this.scrollPercent=t;this.supportsPassiveScrolling=Ni();this.setup()}setup(){this.supportsPassiveScrolling?window.addEventListener("scroll",this.handleScroll,{capture:!0,passive:!0}):window.addEventListener("scroll",this.handleScroll,!0)}remove(){this.supportsPassiveScrolling?window.removeEventListener("scroll",this.handleScroll,{capture:!0}):window.removeEventListener("scroll",this.handleScroll,!0)}}const Bi=1e3;function xi(){return document.timeline&&document.timeline.currentTime?document.timeline.currentTime:performance?performance.now():0}class $i{constructor({onTrigger:e,value:t}){this.onTrigger=e;const i=xi();this.ms=Math.max(t*Bi-i,0);this.timeout=null;this.setup()}setup(){this.timeout=setTimeout((()=>{this.onTrigger(this)}),this.ms)}remove(){this.timeout&&clearTimeout(this.timeout)}}function Ui(e,t){const{showOnPageScroll:i,showOnExitIntent:s,showAfterDelay:n,showAfterInactivity:o,pageScrollPercentageTrigger:r,delayInSeconds:a,inactivityInSeconds:c}=e,l=[];i&&l.push(new Vi({onTrigger:t,value:r||0}));s&&l.push(new Pi({onTrigger:t}));n&&l.push(new $i({onTrigger:t,value:a||0}));o&&l.push(new Ri({onTrigger:t,value:c||0}));return l}function Gi(e,t){const i=new ResizeObserver((i=>{for(const s of i)s.target===e&&s.contentRect&&t(s.contentRect.height,s.contentRect.height)}));i.observe(e);return()=>i.disconnect()}const ji="hubspot-messages-iframe-container",qi=()=>{},Wi=220,zi=400,Yi="userInteractedWithWidget";class Qi{constructor(e){this.disconnectResizeObserver=qi;this.conversationsFrameContainer=null;this.handleConversationsReady=()=>{this.addConversationsEventListeners();this.pollForConversationsRendered().then((()=>{this.conversationsFrameContainer=document.getElementById(ji);this.addConversationsStyleSheet();this.listenForConversationsHeightChange();this.setFloatingButtonOffset()})).catch((()=>{}))};this.overlayContainer=e;this.listenForConversationsReady()}listenForConversationsReady(){window.HubSpotConversations?this.handleConversationsReady():window.hsConversationsOnReady&&window.hsConversationsOnReady.length?window.hsConversationsOnReady=[...window.hsConversationsOnReady,this.handleConversationsReady]:window.hsConversationsOnReady=[this.handleConversationsReady]}listenForConversationsHeightChange(){if(!this.conversationsFrameContainer)return;const e=Gi(this.conversationsFrameContainer,(e=>{this.conversationsFrameContainer&&e{Re()&&this.removeConversationsStyleSheet()}))}pollForConversationsRendered(){return new Promise((e=>{const t=setInterval((()=>{if(document.getElementById(ji)){e();clearInterval(t)}}),zi)}))}setFloatingButtonOffset(){if(!this.overlayContainer||!this.conversationsFrameContainer)return;const e=this.conversationsFrameContainer.clientHeight;this.overlayContainer.addMarginForConversations(e)}addConversationsStyleSheet(){const e=document.createElement("style");e.id="web-interactives-conversations-override";e.innerHTML="#hubspot-messages-iframe-container { z-index: 9990!important; }";document.head.appendChild(e)}removeConversationsStyleSheet(){const e=document.getElementById("web-interactives-conversations-override");e&&e.remove()}}function Xi(e){return new Qi(e)}class Ki{constructor(){this.eventEmitter=n()}static getInstance(){Ki.instance||(Ki.instance=new Ki);return Ki.instance}emit(e,t){this.eventEmitter.emit(e,t)}on(e,t){this.eventEmitter.on(e,t)}off(e){this.eventEmitter.off(e)}reset(){this.eventEmitter.reset()}}const Ji={REFRESH:"REFRESH",CLOSE:"CLOSE",CLOSE_ALL:"CLOSE_ALL",TRIGGER_OPEN:"TRIGGER_OPEN",REPLACED_INLINE_HTML:"REPLACED_INLINE_HTML"},Zi={HAS_CLOSED:"HAS_CLOSED"},es=a;class ts{constructor({configModel:t,environmentModel:i,analyticsModel:s,scheduledCTAsModel:n,handleView:o,scheduleCTA:r}){this.triggerMap=new Map;this.shownModal=null;this.triggeredCTAFromCallback=null;this.clickTriggerComponentMap=new Map;this.interactiveComponentMap=new Map;this.conversationsController=null;this.eventManager=Ki.getInstance();this.listenForKeypress=()=>{z((()=>{this.shownModal&&this.closeOverlay(this.shownModal)}))};this.sendAnalyticsToCTA=t=>{es.broadcast(t,{type:e.RECEIVED_ANALYTICS,payload:this.analyticsModel.analytics})};this.handleTrigger=e=>{if(!Qt(e)){this.openOverlay(e);for(const[t,i]of this.triggerMap)t===e&&i.forEach((e=>e.remove()));this.triggerMap.delete(e)}};this.handleTriggerFromCTA=({triggerCTA:e,id:t})=>{this.interactiveComponentMap.has(t)&&(this.interactiveComponentMap.has(e)?this.shouldCloseCalloutCTA(t)&&this.closeOverlay(t):this.triggeredCTAFromCallback=[e,t]);this.interactiveComponentMap.has(e)?this.handleClickOpen(e):this.scheduledCTAsModel.scheduledCTAs.has(e)||this.scheduleCTA(e)};this.handleClickOpen=e=>{this.openOverlay(e,!0)};this.handleOverlayClick=()=>{if(!Number.isInteger(this.shownModal))return;const e=this.configModel.configs.get(this.shownModal);e&&e.containerStyles.closeOnOverlayClick&&this.closeOverlay(this.shownModal)};this.handlePageNavigation=({id:e,openNewTab:t,url:i})=>{t||v(window.location.href,i)||this.shouldCloseCalloutCTA(e)&&this.environmentModel.patches.closeCTAOnNavigation&&this.shouldCloseCalloutCTA(e)&&this.closeOverlay(e)};this.handleFormSubmission=({id:e})=>{const t=this.configModel.configs.get(e);t&&t.shouldCloseOnFormSubmission&&t.isDismissable&&this.closeOverlay(e)};this.closeOverlay=e=>{const t=this.interactiveComponentMap.get(e);if(t){t.isTopBanner&&this.overlayedInteractivesContainer.hidePushBanner();t.containerType===Q.MODAL&&this.overlay.hide();t.close();e===this.shownModal&&(this.shownModal=null);document.activeElement instanceof HTMLElement&&document.activeElement.blur();this.messageCTAClosed(e)}};this.configModel=t;this.environmentModel=i;this.analyticsModel=s;this.scheduledCTAsModel=n;this.overlayedInteractivesContainer=null;this.overlay=null;this.handleView=o;this.scheduleCTA=r;this.listenToConfigUpdates();this.listenForOpenCTAMessage();this.listenForKeypress();this.registerMessageHandlers();this.triggerOpen=this.handleClickOpen}init({clickTriggerButtons:e}){this.posistionsOccupied=Vt(this.environmentModel.isMobile);this.overlayedInteractivesContainer=new _t;this.overlay=new Rt({parent:this.overlayedInteractivesContainer.topAnchor,handleClick:this.handleOverlayClick});this.conversationsController=Xi(this.overlayedInteractivesContainer);this.createClickTriggerComponents(e)}registerMessageHandlers(){es.registerHandlers({[e.TRIGGER_CTA]:this.handleTriggerFromCTA,[e.NAVIGATE_PAGE]:this.handlePageNavigation,[e.CTA_FORM_SUBMITTED]:this.handleFormSubmission});this.eventManager.on(Ji.TRIGGER_OPEN,(({ctaToOpen:e})=>this.handleClickOpen(e)))}createClickTriggerComponents(e){for(const[t,i]of e)i.forEach((e=>{const i=new _i(e,(()=>this.handleClickOpen(t))),s=this.clickTriggerComponentMap.get(t)||[];this.clickTriggerComponentMap.set(t,[...s,i])}))}createOverlayInteractiveFromAudience(e){if(!this.shouldCreateInteractiveOverlay(e))return!1;if(!this.createOverlayComponentAndSetOnMap(e))return!1;this.posistionsOccupied.setPosistionFromConfig(e);const t=Ui(e.triggers,(()=>this.handleTrigger(e.contentModelId)));this.triggerMap.set(e.contentModelId,t);return!0}createOverlayInteractivesWithAudience(){for(const[e,t]of this.configModel.sortedConfigsWithSpecificty)this.createOverlayInteractiveFromAudience(t)}createOverlayInteractivesWithNoAudience(){for(const[e,t]of this.configModel.overlayedConfigsWithNoAudience){if(this.interactiveComponentMap.has(e))continue;if(!this.createOverlayComponentAndSetOnMap(t))return;if(this.scheduledCTAsModel.scheduledCTAs.has(e)){this.openOverlay(e,!0);this.scheduledCTAsModel.removeCTA(e)}this.sendAnalyticsToCTA(e)}}createTemplateOverlayInteractive(){this.createOverlayComponentAndSetOnMap(this.configModel.templateConfig)}createPreviewOverlayInteractive(){this.createOverlayComponentAndSetOnMap(this.configModel.previewConfig)}createOverlayComponentAndSetOnMap(e){const t=Ai(e,le(e.iframeSrc,this.environmentModel,this.analyticsModel));if(!t)return null;const i=e.contentModelId;if(this.triggeredCTAFromCallback){const[e]=this.triggeredCTAFromCallback;i===e&&t.skipAnimation()}this.interactiveComponentMap.set(i,t);this.overlayedInteractivesContainer.attachInteractiveOverlayToAnchor(t);t.registerResizeHandler((({height:e})=>{t.isTopBanner&&this.overlayedInteractivesContainer.setTopPushHeight(e)}));t.registerCloseHandler((()=>this.closeOverlay(e.contentModelId)));return t}shouldCreateInteractiveOverlay(e){return!(Qt(e.contentModelId)&&!this.clickTriggerComponentMap.has(e.contentModelId))&&!!this.posistionsOccupied.canBeInsertedIntoPosition(e)}listenToConfigUpdates(){this.configModel.store.subscribe(((e,t)=>{if(this.environmentModel.isPreview&&1===e.configs.size){this.createPreviewOverlayInteractive();requestAnimationFrame((()=>{this.configModel.previewConfig&&this.openOverlay(this.configModel.previewConfig.contentModelId)}))}else if(0===t.configs.size&&e.configs.size>0)setTimeout((()=>{this.createOverlayInteractivesWithAudience();this.createOverlayInteractivesWithNoAudience();this.overlay&&this.overlay.enableDisableBodyScroll()}));else if(e.templateConfig){this.createTemplateOverlayInteractive();requestAnimationFrame((()=>{this.openOverlay(Me)}))}else{e.configs.size>t.configs.size&&this.createOverlayInteractivesWithNoAudience();if(this.triggeredCTAFromCallback){const[t,i]=this.triggeredCTAFromCallback;if(e.configs.has(t)){this.triggeredCTAFromCallback=null;this.shouldCloseCalloutCTA(i)&&this.closeOverlay(i)}}}}))}listenForOpenCTAMessage(){window.addEventListener("message",(t=>{t&&t.data&&t.data.type===e.DISPLAY_CALL_TO_ACTION&&this.openOverlay(t.data.id)}))}openOverlay(t,i=!1){const s=this.interactiveComponentMap.get(t);if(s){s.isTopBanner&&this.overlayedInteractivesContainer.showPushBanner(s.container.clientHeight);i&&s.setAnimationForClickTrigger();s.open().then((()=>{s.isTopBanner&&this.overlayedInteractivesContainer.showPushBanner(s.container.clientHeight);if(s.containerType===Q.MODAL){this.shownModal=t;this.overlay.show()}this.handleView(t);es.broadcast(t,{type:e.SHOWING_CTA,payload:{}})})).catch((()=>{}))}}messageCTAClosed(t){es.broadcast(t,{type:e.HAS_CLOSED,payload:{}});this.eventManager.emit(Zi.HAS_CLOSED,{id:t})}shouldCloseCalloutCTA(e){const t=this.configModel.configs.get(e);return!!t&&t.isDismissable}}function is(e){return class extends e{constructor(e){super(e);this.processConfigResponse=e=>{if(!e)return;const t=e.sortedAudienceConfigs.map((e=>e.contentModelId)),i=this.getShowingCTAIds(),s=[];for(const e of i)t.includes(e)||s.push(e);this.handleRemovingCTAs(s);const n=e.sortedAudienceConfigs.sort(((e,t)=>t.specificity-e.specificity));this.createCTAsFromConfigs(n)};this.registerEventManagerEventHandlers()}registerEventManagerEventHandlers(){this.eventManager.on(Ji.REFRESH,(()=>{this.handleRefresh()}));this.eventManager.on(Ji.CLOSE,(({id:e})=>this.closeOverlay(e)));this.eventManager.on(Ji.CLOSE_ALL,(()=>this.handleCloseAll()))}handleCloseAll(){this.getShowingCTAIds().forEach((e=>this.closeOverlay(e)))}handleRefresh(){this.environmentModel.refresh();return this.configModel.init(Le.buildConfigRequest(this.environmentModel,[],this.analyticsModel.store.state)).then(this.processConfigResponse).catch((e=>{}))}getShowingCTAIds(){return this.posistionsOccupied?this.posistionsOccupied.getAllIds():[]}handleRemovingCTAs(e){for(const t of e){this.closeOverlay(t);const e=this.interactiveComponentMap.get(t);e&&e.remove();this.interactiveComponentMap.delete(t);this.posistionsOccupied&&this.posistionsOccupied.removeCTA(t);for(const[e,i]of this.triggerMap){e===t&&i.forEach((e=>e.remove()));this.triggerMap.delete(t)}}}createCTAsFromConfigs(e){for(const t of e)this.createOverlayInteractiveFromAudience(t)}}}var ss=is(ts);const ns="hs-cta-embed__loaded";class os{constructor({contentId:e,embedContainer:t,iframeSrc:i,useResponsiveStyling:s}){this.listenForLoad();this.frameComponent=S({id:e,container:t,iframeSrc:i,resizeHeight:!0,onFrameReady:this.resolveFrameload,useResponsiveStyling:s,extraAttributes:{"aria-label":"Embedded CTA",title:"Embedded CTA",allow:"autoplay; fullscreen; clipboard-write"}});this.frameComponent.iframe.setAttribute("data-test-id","interactive-frame");this.frameComponent.iframe.classList.add(Jt);this.contentId=e;this.embedContainer=t}setStyles(e,i,s){this.frameComponent.setShouldResize(s);t(this.embedContainer,e);this.frameComponent.setStyle(Object.assign({},i));this.resolveConfig&&this.resolveConfig()}showFrame(){this.frameComponent.setStyle({visibility:""})}listenForLoad(){const e=new Promise((e=>{this.resolveFrameload=e})),t=new Promise((e=>{this.resolveConfig=e}));Promise.all([e,t]).then((()=>{Array.from(this.embedContainer.children).forEach((e=>{e!==this.frameComponent.iframe&&this.embedContainer.removeChild(e)}));this.embedContainer.classList.add(ns);this.showFrame()})).catch((()=>{}))}}class rs{constructor({environmentModel:e,configStore:t,handleView:i,analyticsModel:s,scheduledCTAsModel:n}){this.embeddedInteractives=new Map;this.elementObserver=G();this.styledComponentSet=new Set;this.flushScheduledCTAs=()=>{for(const e of this.scheduledCTAsModel.scheduledCTAs){const t=this.configStore.embeddedConfigs.get(e);if(!t||t.isHTMLVersionOnly)continue;if(!this.scheduledCTAsModel.elementsForEmbeddedCTAs.has(e))continue;this.scheduledCTAsModel.elementsForEmbeddedCTAs.get(e).forEach((t=>{this.createView(e,t)}));this.handleView(e);this.scheduledCTAsModel.removeCTA(e)}};this.environmentModel=e;this.configStore=t;this.scheduledCTAsModel=n;this.handleView=i;this.analyticsModel=s}init({embedContainers:e}){this.embedContainers=e;this.environmentModel.isPreview||this.environmentModel.isTemplate||this.createViews();this.listenForConfigs();this.listenForElementViews();this.listenForScheduledCTAs()}listenForScheduledCTAs(){this.scheduledCTAsModel.subscribe(this.flushScheduledCTAs)}listenForElementViews(){if(this.embedContainers)for(const[e,t]of this.embedContainers)for(const i of t)this.elementObserver.observe(i,(()=>this.handleView(e)))}listenForConfigs(){this.configStore.configs.size>0?this.setStylesOnContainer():this.configStore.subscribe((()=>{this.scheduledCTAsModel.scheduledCTAs.size>0&&this.flushScheduledCTAs();if(this.configStore.embeddedConfigs.size>0){(this.environmentModel.isPreview||this.environmentModel.isTemplate)&&this.configStore.embeddedConfigs.size>0&&this.createViews();this.setStylesOnContainer()}}))}setStylesOnContainer(){for(const[e,t]of this.configStore.embeddedConfigs){const i=this.embeddedInteractives.get(e);i&&i.length&&i.forEach((e=>{if(!this.styledComponentSet.has(e)){this.styledComponentSet.add(e);e.setStyles(Le.getStylesFromContainerStyles(t.containerStyles),Le.getStylesForIframe(t.containerStyles),t.containerStyles.scaleHeightToFitContent||Boolean(t.containerStyles.isSingleModuleOnly))}}))}}createViews(){for(const[e,t]of this.embedContainers){let i="";const s=this.configStore.embeddedConfigs.get(e);i=s?s.iframeSrc:ce({contentId:e,portalId:this.environmentModel.portalId,env:this.environmentModel.env,hublet:this.environmentModel.hublet});i=le(i,this.environmentModel,this.analyticsModel);const n=[];t.forEach((t=>{const o=new os({contentId:e,embedContainer:t,iframeSrc:i,useResponsiveStyling:!!s&&s.containerStyles.useResponsiveStyling});n.push(o)}));this.embeddedInteractives.set(e,n)}}createView(e,t){const i=this.configStore.embeddedConfigs.get(e);if(!i)return;const s=le(i.iframeSrc,this.environmentModel,this.analyticsModel),n=new os({contentId:e,embedContainer:t,iframeSrc:s,useResponsiveStyling:i.containerStyles.useResponsiveStyling}),o=this.embeddedInteractives.get(e)||[];this.embeddedInteractives.set(e,[...o,n]);this.setStylesOnContainer()}}const as="POP_OVER",cs="hsCta";class ls{constructor({configStore:e,environmentModel:t}){this.eventManager=Ki.getInstance();this.ignoreCta=({id:e})=>{if(this.environmentModel.isPreview)return;const t=this.configStore.configs.get(e);t&&t.containerType!==Q.EMBEDDED&&Xt(e,t.displayFrequency)};this.registerPopupPolice=({id:e})=>{const t=this.configStore.configs.get(e);t&&t.containerType===Q.MODAL&&window._registerAvailablePopup&&window._registerAvailablePopup(cs,as)};this.configStore=e;this.environmentModel=t;this.registerHandlers();this.listenForConfigs()}registerHandlers(){es.registerHandlers({[e.NAVIGATE_PAGE]:this.ignoreCta,[e.STARTED]:this.registerPopupPolice});this.eventManager.on(Zi.HAS_CLOSED,this.ignoreCta)}listenForConfigs(){this.configStore.subscribe(((e,t)=>{if(e.configs.size!==t.configs.size)for(const[t,i]of e.configs)i.displayFrequency&&Kt(t,i.displayFrequency)}))}}function hs(e){return new ls(e)}const ds=rt(["display:flex;justify-content:center;align-items:center;"]),us="interactive-ready";class ms{constructor({environmentModel:e}){this.environmentModel=e}init(){if(this.environmentModel.isPreview||this.environmentModel.isScreenshot||this.environmentModel.templatePath){this.bodyWrapper=document.getElementsByClassName(Ue)[0];if(this.bodyWrapper){this.setupEmbedContainer();this.setHeightForPreview();this.listenForInteractiveLoaded()}}}setupEmbedContainer(){this.bodyWrapper.classList.add(ds);const e=this.environmentModel.previewId||1;this.environmentModel.isTemplate?this.bodyWrapper.innerHTML=`\n
\n `:this.bodyWrapper.innerHTML=`\n
\n `}setHeightForPreview(){this.bodyWrapper.style.height="100vh"}listenForInteractiveLoaded(){es.registerHandlers({[e.STARTED]:()=>document.body.classList.add(us)})}}function gs({environmentModel:e}){return new ms({environmentModel:e})}const ps=e=>{let t=1,i=0;for(;t>0&&i!==e.length;){const s=e[i];"{"===s?t++:"}"===s&&t--;i++;if(i>e.length)return e.length}return i},fs=e=>window.matchMedia(e).matches,vs=e=>e.includes("width")?"@media (min-width: 0px)":e,Cs=(e,t=fs)=>{let i="",s=e,n=s.indexOf("@media");if(-1===n)return!1;for(;n>0;){i=`${i}${s.substring(0,n-1)}`;s=s.substring(n);const e=s.indexOf("{"),o=s.substring(0,e);s=s.substring(e+1);const r=ps(s);if(t(o.replace("@media ",""))){const e=s.substring(0,r-1);i=`${i}${vs(o)} { ${e} }`}s=s.substring(r+1);n=s.indexOf("@media")}return`${i}${s}`.trim()},Ts=e=>Object.keys(e).reduce(((t,i)=>{const s=Cs(e[i]);return s?Object.assign({},t,{[i]:s}):t}),{});var Es=(e,t)=>{let i=0;return(...s)=>{i&&clearTimeout(i);i=setTimeout((()=>{e(...s);i=0}),t)}};const Ss=(...e)=>{i("[ResponsiveController]",...e)};class bs{constructor(){this.initialStylesheets={}}init(){this.listenForStylesheetsHtml();const e=Es((()=>Object.keys(this.initialStylesheets).forEach((e=>this.handleProcessStylesheets(Number(e))))),100);window.addEventListener("resize",(()=>{Ss("Resizing, reprocessing stylesheets");e()}))}listenForStylesheetsHtml(){es.registerHandlers({[e.SEND_STYLESHEETS]:e=>{this.initialStylesheets[e.id]=e.stylesheetsHtml;this.handleProcessStylesheets(e.id)}})}handleProcessStylesheets(t){if(!this.initialStylesheets[t])return;const i=Ts(this.initialStylesheets[t]);es.broadcast(t||1,{type:e.RECEIVE_FILTERED_STYLESHEETS,payload:{stylesheets:i}})}}function ys(){return new bs}function ws(e,t){return"https://perf{region}.hsforms{env}.com/embed/v3/counters.gif".replace("{region}",`-${e}`).replace("{env}","qa"===t?"qa":"")}const As={CONFIG_LOADED_SUCCESS:"config-loaded-success",CONFIG_LOADED_FAILURE:"config-loaded-failure",INTERACTIVE_SHOWN:"interactive-shown",INTERACTIVE_CLOSED:"interactive-closed",INTERACTIVE_NAVIGATED:"interactive-navigated",INLINE_INTERACTIVE_RENDER_SUCCESS:"inline-interactive-render-success",INLINE_INTERACTIVE_RENDER_FAIL:"inline-interactive-render-fail"};class Is{constructor({environmentModel:e,configStore:t}){this.perfUrl="";this.environmentModel=e;this.configStore=t;this.registerHandlers();this.listenToConfigStore()}init(){this.perfUrl=ws(this.environmentModel.hublet,this.environmentModel.env)}trackRender(e){this.trackMetric(e?As.INLINE_INTERACTIVE_RENDER_SUCCESS:As.INLINE_INTERACTIVE_RENDER_FAIL)}registerHandlers(){es.registerHandlers({[e.STARTED]:()=>this.trackMetric(As.INTERACTIVE_SHOWN),[e.CLOSE_INTERACTIVE]:()=>this.trackMetric(As.INTERACTIVE_CLOSED),[e.NAVIGATE_PAGE]:()=>this.trackMetric(As.INTERACTIVE_NAVIGATED)})}listenToConfigStore(){this.configStore.subscribe((e=>{e.requestError?this.trackMetric(As.CONFIG_LOADED_FAILURE):e.isLoaded&&this.trackMetric(As.CONFIG_LOADED_SUCCESS)}))}trackMetric(e){if(!this.perfUrl.length)return;const t=`${this.perfUrl}?key=${e}&value=1`;(new Image).src=t}}function Os(e){return new Is(e)}function Ms({env:e,hublet:t=X}){return be({env:"prod"===e?"":e,hublet:t||X,path:"track",contentIds:[],extraParams:{}})}const _s=(...e)=>{i("[CTAAnalyticsController]",...e)};class Ps{constructor({analyticsStore:e,configsStore:t,environmentModel:i,ctaViewedStore:s}){this.timingMap=new Map;this.viewQueue=w();this.abTestViewQueueSet=new Set;this.hasViewed=new Set;this.eventManager=Ki.getInstance();this.embedIdToVarientMap=new Map;this.baseUrl="";this.trackView=({id:e})=>{if(!this.configStore.isLoaded){this.viewQueue.enqueue(e);return}const t=this.configStore.configs.get(e);if(null==t||!t.isActiveAbTest||this.embedIdToVarientMap.has(e)){this.trackWithImage(e,"view");this.timingMap.set(e,Date.now())}else this.abTestViewQueueSet.add(e)};this.trackClose=({id:e})=>{this.trackWithImage(e,"close")};this.trackTriggerClick=({id:e})=>{this.trackNavigation({id:e},!0)};this.trackNavigation=({id:e},t=!1)=>{const i=this.configStore.configs.get(e);if(!i)return;const s=new URL(this.attachTrackingParamsToUrl(`${this.baseUrl}/click`,e));(t||i.shouldUseJsTracking)&&s.searchParams.set("beaconTrack","true");s.searchParams.has("beaconTrack")&&("sendBeacon"in navigator?navigator.sendBeacon(s):fetch(s,{method:"POST",keepalive:!0}))};this.handleCTAStarted=({id:e,contentId:t})=>{if(t){this.embedIdToVarientMap.set(e,t);if(this.abTestViewQueueSet.has(e)){this.abTestViewQueueSet.delete(e);this.trackView({id:e})}}};this.analyticsStore=e;this.configStore=t;this.environmentModel=i;this.ctaViewedStore=s}init(){this.baseUrl=Ms({env:this.environmentModel.env,hublet:this.environmentModel.hublet});if(!this.environmentModel.isPreview&&!this.environmentModel.isTemplate){this.registerHandlers();this.listenForStoreLoad();this.listenForViewChange();this.handleViews()}}registerHandlers(){es.registerHandlers({[e.CLOSE_INTERACTIVE]:this.trackClose,[e.NAVIGATE_PAGE]:this.trackNavigation,[e.TRIGGER_CTA]:this.trackTriggerClick,[e.STARTED]:this.handleCTAStarted});this.eventManager.on(Ji.TRIGGER_OPEN,(({ctaTrigger:e})=>this.trackTriggerClick({id:e})))}listenForStoreLoad(){this.configStore.subscribe(((e,t)=>{e.isLoaded&&!t.isLoaded&&this.flushViewQueue()}))}listenForViewChange(){this.ctaViewedStore.subscribe((()=>{this.handleViews()}))}handleViews(){for(const e of this.ctaViewedStore.viewed)if(!this.hasViewed.has(e)){this.trackView({id:e});this.hasViewed.add(e)}}flushViewQueue(){do{const e=this.viewQueue.dequeue();e&&this.trackView({id:e})}while(this.viewQueue.peek())}trackWithImage(e,t){_s("Tracking:",t,e);let i=`${this.baseUrl}/${t}`;i=this.attachTrackingParamsToUrl(i,e);(new Image).src=i}logTooLargeAnalytics(){_s("Logging url that will be truncated");const e=this.analyticsStore.analytics;if(!e)return;const t=JSON.stringify(Object.assign({},e,{portalId:this.environmentModel.portalId}));fetch(`${this.baseUrl}/log`,{method:"POST",headers:{"Content-Type":"application/json"},body:t})}attachTrackingParamsToUrl(e,t){const i=new URL(e),s=this.configStore.configs.get(t);if(!s)return i.href;i.searchParams.set("webInteractiveContentId",String(t));s.isActiveAbTest&&this.embedIdToVarientMap.has(t)&&i.searchParams.set("webInteractiveContentId",String(this.embedIdToVarientMap.get(t)));i.searchParams.set("webInteractiveId",String(s.webInteractiveId));i.searchParams.set("containerType",s.containerType);i.searchParams.set("portalId",String(this.environmentModel.portalId));i.searchParams.set("audienceId",String(s.audienceId));s.campaignGuid&&i.searchParams.set("campaignId",s.campaignGuid);const n=this.analyticsStore.analytics;n&&Object.entries(n).forEach((([e,t])=>{t&&i.searchParams.set(e,String(t))}));const o=this.timingMap.get(t);if(o){i.searchParams.set("timeStarted",String(o));i.searchParams.set("timeFinished",String(Date.now()))}i.href.length;return i.href}}function Ls(e){return new Ps(e)}const Fs=["elementToEmbed"];class Rs{constructor({configModel:e,customerCtaOptions:t,scheduleCTA:i}){this.defferedPromiseMap=new Map;this.handleCtaLoad=({id:e})=>{if(!this.defferedPromiseMap.has(e))return;this.defferedPromiseMap.get(e)(null);this.defferedPromiseMap.delete(e)};this.handleNavigate=({id:e})=>{const t=this.customerCtaOptions.options.get(e);t&&"function"==typeof t.onNavigate&&t.onNavigate()};this.loadCta=e=>new Promise(((t,i)=>{e||i(new Error("Invalid options"));const{contentId:s,options:n}=e,{elementToEmbed:o}=n,r=he(n,Fs);s||i(new Error("Invalid options"));this.scheduleCTA(s,Array.isArray(o)?o:[o]);Object.keys(r).length&&this.customerCtaOptions.setOption(s,r);this.defferedPromiseMap.set(s,t)}));this.configModel=e;this.customerCtaOptions=t;this.scheduleCTA=i;window.hsCtasOnReady=window.hsCtasOnReady||[];this.attachToWindow();this.registerHandlers()}init(){this.flushOnReadyQueue()}registerHandlers(){es.registerHandlers({[e.STARTED]:this.handleCtaLoad,[e.NAVIGATE_PAGE]:this.handleNavigate})}attachToWindow(){window.__PRIVATE__HubspotCtaClient={loadCta:this.loadCta}}flushOnReadyQueue(){const e=window.hsCtasOnReady;for(;e.length;){const t=e.shift();"function"==typeof t&&t()}Object.defineProperty(window.hsCtasOnReady,"push",{value:e=>{"function"==typeof e&&e()},writable:!0})}}function Ns(e){return new Rs(e)}const Hs=(...e)=>{i("[NonFramedCTA]",...e)};class ks{constructor({cta:e,onNavigate:t,onView:i}){this.removeEventListenerCallbacks=[];this.elementObserver=G();this.hasView=!1;this.id="";this.cta=e;this.id=this.cta.id;this.onNavigate=t;this.onView=i;this.listenForAnchorClicks();this.listenForView()}getCtaInstance(){this.cta&&this.cta.parentNode||(this.cta=document.getElementById(this.id));return this.cta}replaceCtaInstance(e){Hs("Replacing html",e,this.id);const t=this.getCtaInstance();if(!t)return;const i=Ke(t,e);this.removeExistingEventListeners();t.innerHTML=i.innerHTML;t.dataset.rendered="true";this.reapplyEventListeners(t)}removeExistingEventListeners(){this.hasView||this.elementObserver.unobserve(this.cta);this.removeEventListenerCallbacks.forEach((e=>e()));this.removeEventListenerCallbacks=[]}reapplyEventListeners(e){this.id=e.id;this.cta=e;this.listenForAnchorClicks();this.hasView||this.listenForView()}listenForAnchorClicks(){const e=[...this.cta.querySelectorAll("a")];"A"===this.cta.tagName&&e.push(this.cta);for(const t of e){const e="_blank"===t.target,i=e=>{e.preventDefault()};let s;t.classList.contains("hs-cta-trigger-button")&&(s=ze(t));const n=i=>{i.preventDefault();Ii(i)&&this.onNavigate(t.href,e,s)},o=i=>{if("Enter"===i.key){i.preventDefault();this.onNavigate(t.href,e,s)}};t.addEventListener("click",i);t.addEventListener("mouseup",n);t.addEventListener("keydown",o);this.removeEventListenerCallbacks.push((()=>{t.removeEventListener("click",i);t.removeEventListener("mouseup",n);t.removeEventListener("keypress",o)}))}}listenForView(){this.elementObserver.observe(this.cta,(()=>{this.onView();this.hasView=!0;this.elementObserver.unobserve(this.cta)}))}}function Ds(e){return new ks(e)}const Vs=(...e)=>{i("[populateLinksWithTrackingParams]",...e)},Bs=["currentUrl","referrer","canon","canonicalUrl","pageUrl","contentType","encryptedPayload","pageId","analyticsPageId","hutk","hstc","hssc","hsfp","utk","containerType","webInteractiveId","webInteractiveContentId","audienceId","campaignGuid","campaignId","userAgent","timeStarted","timeFinished","redirectUrl","skip","includeInitial","pageTitle","contentGroupId","portalId","hsCtaAttrib"],xs=`https://${(new Date).getTime()}-dummy.com`,$s=(e,t)=>{let i,s=!1;try{i=new URL(e)}catch(t){Vs("[populateLinksWithTrackingParams]","Checking for relative URL",e);s=!0}if(s)try{i=new URL(`${xs}${e.startsWith("/"),""}${e}`)}catch(t){Vs("Could not parse url for link",t);return e}Object.entries(t).forEach((([e,t])=>{Bs.includes(e)?null!=t&&i.searchParams.set(e,String(t)):Vs("Invalid analytics parameter passed",e)}));const n=i.href;return s?n.replace(xs,""):n};var Us=(e,t=[...document.querySelectorAll(".hs-web-interactive a")])=>{t.length&&t.forEach((t=>{const i=t.getAttribute("href");i&&!i.startsWith("javascript")&&t.setAttribute("href",$s(i,e))}))};const Gs=["isHubspotPage"],js="render/html";function qs(e){let{isHubspotPage:t}=e,i=he(e,Gs);const s={};t&&(s.isHubspotPage="true");return be(Object.assign({},i,{extraParams:s,path:js}))}class Ws{constructor(){this.handleFetchFailed=()=>{this.store.setState((e=>Object.assign({},e,{requestError:!0})))};this.handleFetchSucceded=e=>{this.store.setState((t=>Object.assign({},t,{renderedHtmlMap:Object.assign({},t.renderedHtmlMap,{htmlMap:e}),isLoaded:!0})))};const e={renderedHtmlMap:{},request:null,requestError:!1,isLoaded:!1};this.store=new b(e)}init(e){this.store.setState((t=>Object.assign({},t,{request:e})));return this.fetchEmbeddedHtml()}subscribe(e){this.store.subscribe(e)}get renderedHtmlMap(){return this.store.state.renderedHtmlMap}get isLoaded(){return this.store.state.isLoaded}fetch(e){return fetch(e).then((e=>{if(!e.ok){this.handleFetchFailed();return Promise.resolve(null)}return e.json().then((e=>{this.handleFetchSucceded(e);return e})).catch(this.handleFetchFailed)})).catch(this.handleFetchFailed)}fetchEmbeddedHtml(){const e=this.store.state.request;if(!e)return Promise.resolve(null);const t=qs(e);return this.fetch(t)}}var zs=new Ws;const Ys=(...e)=>{i("[NonFramedCTAController",...e)};class Qs{constructor({handleView:e,configStore:t,handleNavigation:i,analyticsStore:s,environmentModel:n,metricsController:o,scheduledCTAsModel:r}){this.componentMap=new Map;this.eventManager=Ki.getInstance();this.cleanupFuncs=[];this.flushScheduledCTAs=()=>{for(const e of this.scheduledCTAsModel.scheduledCTAs){const t=this.configStore.embeddedConfigs.get(e);if(!t||!t.isHTMLVersionOnly)return;if(!this.scheduledCTAsModel.elementsForEmbeddedCTAs.has(e))return;const i=this.scheduledCTAsModel.elementsForEmbeddedCTAs.get(e);let s=this.nonFramedCTAContainers.get(e);s||(s=[]);this.nonFramedCTAContainers.set(e,[...s,...i]);this.createViewsForElements(e,i);this.requestHTML();this.scheduledCTAsModel.removeCTA(e)}};this.getAnchorsFromElements=e=>{let t=[];e.forEach((e=>{"A"===e.tagName&&(t=[...t,e]);t=[...t,...e.querySelectorAll("a")]}));return t};this.handleView=e;this.handleNavigation=i;this.configStore=t;this.analyticsStore=s;this.environmentModel=n;this.renderedHtmlStore=zs;this.metricsController=o;this.scheduledCTAsModel=r}init({nonFramedCTAContainers:e}){this.nonFramedCTAContainers=e;e.size&&this.requestHTML();this.listenForConfigs();this.listenForScheduledCTAs();this.environmentModel.isPreview||this.environmentModel.isPreviewPage||this.listenForAnalyticsUpdate()}listenForScheduledCTAs(){this.scheduledCTAsModel.subscribe(this.flushScheduledCTAs)}cleanup(){this.cleanupFuncs.forEach((e=>e()))}requestHTML(){const e=e=>{if(!e)return;this.metricsController.trackRender(!0);Object.keys(e).forEach((t=>{const i=Number(t),s=e[i],n=this.componentMap.get(i);if(n)n.forEach((e=>{e.replaceCtaInstance(s)}));else{Ys("Views not created yet, just replacing existing elements");const e=this.nonFramedCTAContainers.get(i);e&&e.length&&e.forEach((e=>{const t=Ke(e,s);e.innerHTML=t.innerHTML;e.dataset.rendered="true"}))}this.hydrateLinksWithAllData(i)}));const t=Object.keys(e).map(Number);this.eventManager.emit(Ji.REPLACED_INLINE_HTML,{ids:t})},{isPreview:t,currentUrl:i,portalId:s,env:n,hublet:o,versionId:r}=this.environmentModel,a=[...this.nonFramedCTAContainers.keys()].filter((e=>!this.renderedHtmlStore.renderedHtmlMap[e]));if(!a.length)return;const c={contentIds:a,currentUrl:i,portalId:s,env:n,hublet:o,analytics:this.analyticsStore.analytics,isPreview:t,versionId:r,isHubspotPage:this.environmentModel.isCos()};Ys("Requesting HTML",c);this.renderedHtmlStore.init(c).then(e).catch((e=>{Ys("Failed getting HTML",e);this.metricsController.trackRender(!1)}))}createViewsForElements(e,t){const i=[];let s=0;for(const n of t){n.id=`hs-cta-${e}-${s++}`;const o=Ds({cta:n,onNavigate:(t,i,s)=>{s?this.eventManager.emit(Ji.TRIGGER_OPEN,{ctaToOpen:s,ctaTrigger:e}):this.handleNavigation(t,e,i)},onView:()=>{this.handleView(e)}});i.push(o);const r=this.configStore.configs.get(e);if(r){const i=this.getAnchorsFromElements(t);Us({webInteractiveContentId:e,webInteractiveId:r.webInteractiveId,audienceId:r.audienceId,containerType:r.containerType,campaignId:r.campaignGuid,pageUrl:this.environmentModel.currentUrl,portalId:this.environmentModel.portalId},i)}}const n=this.componentMap.get(e)||[];this.componentMap.set(e,[...n,...i])}createViews(){for(const[e,t]of this.nonFramedCTAContainers)this.createViewsForElements(e,t)}hydrateLinksWithAllData(e){let t={};const i=this.configStore.configs.get(e);i&&(t={webInteractiveContentId:e,webInteractiveId:i.webInteractiveId,audienceId:i.audienceId,containerType:i.containerType,campaignId:i.campaignGuid,pageUrl:this.environmentModel.currentUrl,portalId:this.environmentModel.portalId});const s=this.analyticsStore.analytics;t=Object.assign({},t,s);let n=[];for(const[,e]of this.nonFramedCTAContainers)n=[...n,...this.getAnchorsFromElements(e)];Us(t,n)}listenForConfigs(){this.cleanupFuncs.push(this.configStore.subscribe((()=>{this.scheduledCTAsModel.scheduledCTAs.size>0&&this.flushScheduledCTAs();this.createViews()})))}listenForAnalyticsUpdate(){const e=()=>{let e=[];for(const[,t]of this.nonFramedCTAContainers)e=[...e,...this.getAnchorsFromElements(t)];Us(this.analyticsStore.analytics,e)};this.analyticsStore.analytics.isLoaded?e():this.cleanupFuncs.push(this.analyticsStore.subscribe(((t,i)=>{!i.isLoaded&&t.isLoaded&&e()})))}}function Xs(e){return new Qs(e)}const Ks=["openInNewTab","onNavigate"];class Js{constructor(){const e={options:new Map};this.store=new b(e)}subscribe(e){this.store.subscribe(e)}setOption(e,t){const{openInNewTab:i,onNavigate:s}=t;he(t,Ks);this.store.setState((t=>{const n=structuredClone(t.options);n.set(e,{openInNewTab:i,onNavigate:s});return Object.assign({},t,{options:n})}))}get options(){return this.store.state.options}}function Zs(){return new Js}class en{constructor(){const e={scheduledCTAs:new Set,elementsForEmbeddedCTAs:new Map};this.store=new b(e)}subscribe(e){this.store.subscribe(e)}scheduleCTA(e){this.store.setState((t=>Object.assign({},t,{scheduledCTAs:new Set([...t.scheduledCTAs,e])})))}scheduleEmbeddedCTA(e,t){this.store.setState((i=>Object.assign({},i,{scheduledCTAs:new Set([...i.scheduledCTAs,e]),elementsForEmbeddedCTAs:W(i.elementsForEmbeddedCTAs,new Map([[e,t]]))})))}removeCTA(e){this.store.setState((t=>{const i=structuredClone(t.scheduledCTAs);i.delete(e);return Object.assign({},t,{scheduledCTAs:i,elementsForEmbeddedCTAs:j(t.elementsForEmbeddedCTAs,((t,i)=>i!==e))})}))}get scheduledCTAs(){return this.store.state.scheduledCTAs}get elementsForEmbeddedCTAs(){return this.store.state.elementsForEmbeddedCTAs}}function tn(){return new en}const sn={onCallToActionReady:"onCallToActionReady",onCallToActionViewed:"onCallToActionViewed",onCallToActionNavigated:"onCallToActionNavigated",onCallToActionFormSubmitted:"onCallToActionFormSubmitted",onCallToActionReplacedInlineHTML:"onCallToActionReplacedInlineHTML"},nn="hsCallsToActionCallback",on=1e3;class rn{constructor({configModel:e}){this.eventEmitter=n();this.eventManager=Ki.getInstance();this.refresh=Y((()=>{this.eventManager.emit(Ji.REFRESH,{})}),on);this.configModel=e;window.hsCallsToActionsReady=window.hsCallsToActionsReady||[];this.registerHandlers()}init(){this.attachToWindow();this.flushOnReadyQueue()}handleView(e){this.handleEventCall({id:e},sn.onCallToActionViewed)}closeAll(){this.eventManager.emit(Ji.CLOSE_ALL,{})}close(e){this.eventManager.emit(Ji.CLOSE,{id:e})}attachToWindow(){window.HubSpotCallsToActions={on:this.eventEmitter.on.bind(this.eventEmitter),off:this.eventEmitter.off.bind(this.eventEmitter),refresh:this.refresh,closeAll:this.closeAll.bind(this),close:this.close.bind(this)}}flushOnReadyQueue(){const e=window.hsCallsToActionsReady;for(;e.length;){const t=e.shift();"function"==typeof t&&t()}Object.defineProperty(window.hsCallsToActionsReady,"push",{value:e=>{"function"==typeof e&&e()},writable:!0})}handleEventCall(e,t){this.eventEmitter.emit(t,e);window.postMessage({type:nn,id:e.id,eventName:t,data:e})}registerHandlers(){es.registerHandlers({[e.STARTED]:e=>this.handleEventCall(e,sn.onCallToActionReady),[e.NAVIGATE_PAGE]:e=>this.handleEventCall(e,sn.onCallToActionNavigated),[e.CTA_FORM_SUBMITTED]:e=>this.handleEventCall(e,sn.onCallToActionFormSubmitted)});this.eventManager.on(Ji.REPLACED_INLINE_HTML,(e=>this.handleEventCall(e,sn.onCallToActionReplacedInlineHTML)))}}function an(e){return new rn(e)}class cn{constructor(e){this.environmentModel=e.environmentModel;this.configStore=e.configsStore}init(){window.addEventListener("pageshow",(e=>{e.persisted&&this.shouldReloadPage()&&window.location.reload()}))}shouldReloadPage(){return this.environmentModel.patches.bfCacheReload&&this.configStore.configs.size>0}}function ln(e){return new cn(e)}const hn=(...e)=>{i("[WebInteractiveApplicationContainer]",...e)};function dn(e){const[t,i]=e.split("?");if(!i)return{location:t,queryParams:{}};return i.split("&").reduce(((e,t)=>{const[i,s]=t.split("=");return Object.assign({[i]:s},e)}),{})}class un extends ${constructor({configStore:e,environmentModel:t}){super();this.scheduleCTA=(e,t)=>{t?this.scheduledCTAs.scheduleEmbeddedCTA(e,t):this.scheduledCTAs.scheduleCTA(e);this.configStore.fetchConfigsWithIds([e])};this.handleView=e=>{this.viewedStore.markAsViewed(e);this.analyticsProxyController.flushViewQueue(e);this.thirdPartyApiController.handleView(e)};this.handleNavigation=(e,t,i=!1)=>{A(this.getNavigationUrl({url:e,openNewTab:i},t),i)};this.configStore=e;this.environmentModel=t;this.viewedStore=Be();this.customerCTAOptions=Zs();this.scheduledCTAs=tn();this.overlayedInteractivesController=new ss({configModel:this.configStore,environmentModel:t,analyticsModel:this.analyticsStore,scheduledCTAsModel:this.scheduledCTAs,handleView:this.handleView,scheduleCTA:this.scheduleCTA});this.embeddedInteractivesController=new rs({environmentModel:t,configStore:e,scheduledCTAsModel:this.scheduledCTAs,analyticsModel:this.analyticsStore,handleView:this.handleView});this.ignorerController=hs({configStore:e,environmentModel:t});this.previewController=gs({environmentModel:this.environmentModel});this.responsiveController=ys();this.metricsController=Os({environmentModel:this.environmentModel,configStore:e});this.ctaAnalyticsController=Ls({configsStore:this.configStore,analyticsStore:this.analyticsStore,environmentModel:this.environmentModel,ctaViewedStore:this.viewedStore});this.apiClientController=Ns({configModel:this.configStore,customerCtaOptions:this.customerCTAOptions,scheduleCTA:this.scheduleCTA});this.thirdPartyApiController=an({configModel:this.configStore});this.nonFramedCTAController=Xs({configStore:this.configStore,handleView:this.handleView,analyticsStore:this.analyticsStore,handleNavigation:this.handleNavigation,environmentModel:this.environmentModel,metricsController:this.metricsController,scheduledCTAsModel:this.scheduledCTAs});this.bfCacheController=ln({environmentModel:this.environmentModel,configsStore:this.configStore});this.listenForConfigs()}init(){this.environmentModel.init();this.metricsController.init();this.previewController.init();this.responsiveController.init();this.parsedDomResults=Xe();this.configStore.init(this._buildConfigRequest()).then((e=>{this.processConfigResponse(e)})).catch((e=>{hn("Error fetching configs",e)}));this.embeddedInteractivesController.init({embedContainers:this.parsedDomResults.embedContainers});this.nonFramedCTAController.init({nonFramedCTAContainers:this.parsedDomResults.nonFramedCTAContainers});this.overlayedInteractivesController.init({clickTriggerButtons:this.parsedDomResults.clickTriggerButtons});this.ctaAnalyticsController.init();this.apiClientController.init();this.thirdPartyApiController.init();this.bfCacheController.init()}_buildConfigRequest(){let e=[];const{isPreview:t,previewId:i}=this.environmentModel;e=t&&i?[i]:[...this.parsedDomResults.uniqueIds];return Le.buildConfigRequest(this.environmentModel,e,this.analyticsStore.store.state)}getNavigationUrl({url:e},t){const i=new URL(e);if(!i.searchParams.has("encryptedPayload"))return e;const s=dn(e),n=this.configStore.configs.get(t);if(!n)return e;i.searchParams.set("webInteractiveId",String(n.webInteractiveId));i.searchParams.set("containerType",n.containerType);n.campaignGuid&&i.searchParams.set("campaignId",n.campaignGuid);n.contentModelId&&i.searchParams.set("webInteractiveContentId",String(n.contentModelId));n.audienceId&&i.searchParams.set("audienceId",String(n.audienceId));this.analyticsStore.analytics.hutk&&i.searchParams.set("hutk",this.analyticsStore.analytics.hutk);this.environmentModel.language&&i.searchParams.set("hsLang",this.environmentModel.language);i.searchParams.delete("encryptedPayload");return decodeURIComponent(s.encryptedPayload)===s.encryptedPayload?`${i.href}&encryptedPayload=${encodeURIComponent(s.encryptedPayload)}`:`${i.href}&encryptedPayload=${s.encryptedPayload}`}getShouldOpenNewTab(e,t){if(!this.customerCTAOptions.options.has(t))return e.openNewTab;return this.customerCTAOptions.options.get(t).openInNewTab||!1}listenForConfigs(){this.configStore.subscribe(((t,i)=>{setTimeout((()=>{if(t.configs.size!==i.configs.size)for(const[t,i]of this.configStore.configs)es.broadcast(t,{type:e.SEND_CTA_CONFIG,payload:Object.assign({portalId:this.environmentModel.portalId,pageUrl:this.environmentModel.currentUrl,pageTitle:document.title,gates:this.environmentModel.gates,pageId:this.environmentModel.pageId,hutk:this.analyticsStore.analytics.hutk},i)})}))}))}processConfigResponse(e){if(e&&Array.isArray(e.gates)){hn("Retrieved Gates from config response",e.gates);this.environmentModel.setGates(e.gates)}}}const mn=new un({configStore:Fe,environmentModel:De});window.__hsWebInteractiveInstance=mn;var gn=mn;const pn=()=>!(!window.disabledHsPopups||!(window.disabledHsPopups.indexOf("LEADFLOW")>-1||window.disabledHsPopups.indexOf("CTAS")>-1))||!!window.hsInEditor;function fn(){document.querySelectorAll(".hs-cta-embed").forEach((e=>{e.classList.add("hs-cta-embed__loaded");const t=e.querySelector(".hs-cta-loading-dot__container");t&&t.remove();const i=e.querySelector(".hs-cta-embed__skeleton");i&&i.remove()}))}function vn(){fn();new MutationObserver((e=>{for(const t of e)"childList"===t.type&&t.addedNodes.forEach((e=>{1===e.nodeType&&e instanceof HTMLElement&&e.querySelector(".hs-cta-embed")&&fn()}))})).observe(document.body,{childList:!0,subtree:!0})}const Cn=()=>{if(pn()){if(window.hsInEditor)try{vn()}catch(e){console.error("Error marking cta embed preview as loaded",e)}}else if(window.hubspot_web_interactives_running)console.error("duplicate instance of web interactives app exists");else{gn.init();window.hubspot_web_interactives_running=!0}},Tn=()=>{Cn();document.removeEventListener("DOMContentLoaded",Tn)};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",Tn):Cn()}();